From: Dmitri Shuralyov Date: Mon, 24 Apr 2023 15:26:23 +0000 (-0400) Subject: cmd/api: make api/next/* entries required, not optional X-Git-Tag: go1.21rc1~765 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=0972096c5c2facec2d5c6db08a2df32684f41caa;p=gostls13.git cmd/api: make api/next/* entries required, not optional We want the API check to catch if some API present in api/next/* files is no longer implemented in the tree, and report it in the same CL that is making the change (by failing loudly). Arguably this should've been the case since CL 315350, but I didn't notice it at the time. Do it now. For #43956. Change-Id: I73330dd5fd3f5706a1fdf13b2bf8e0f24c6b48e5 Reviewed-on: https://go-review.googlesource.com/c/go/+/488135 Reviewed-by: Dmitri Shuralyov Run-TryBot: Dmitri Shuralyov TryBot-Result: Gopher Robot Reviewed-by: Bryan Mills Auto-Submit: Dmitri Shuralyov --- diff --git a/src/cmd/api/api.go b/src/cmd/api/api.go index f0d48e3ccd..4dd33b13a5 100644 --- a/src/cmd/api/api.go +++ b/src/cmd/api/api.go @@ -193,13 +193,12 @@ func Check(t *testing.T) { bw := bufio.NewWriter(os.Stdout) defer bw.Flush() - var required []string + var required, optional []string for _, file := range checkFiles { required = append(required, fileFeatures(file, needApproval(file))...) } - var optional []string for _, file := range nextFiles { - optional = append(optional, fileFeatures(file, true)...) + required = append(required, fileFeatures(file, true)...) } exception := fileFeatures(filepath.Join(testenv.GOROOT(t), "api/except.txt"), false)