From 0972096c5c2facec2d5c6db08a2df32684f41caa Mon Sep 17 00:00:00 2001 From: Dmitri Shuralyov Date: Mon, 24 Apr 2023 11:26:23 -0400 Subject: [PATCH] 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 --- src/cmd/api/api.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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) -- 2.48.1