]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/api: make api/next/* entries required, not optional
authorDmitri Shuralyov <dmitshur@golang.org>
Mon, 24 Apr 2023 15:26:23 +0000 (11:26 -0400)
committerGopher Robot <gobot@golang.org>
Thu, 27 Apr 2023 14:06:36 +0000 (14:06 +0000)
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 <dmitshur@google.com>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>

src/cmd/api/api.go

index f0d48e3ccd51375c00f3e78ab4e2691152a167cc..4dd33b13a50f2cdda430462b1b3e147d0d78b256 100644 (file)
@@ -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)