]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/gofmt: don't descend into /testdata directories in tests (fix long builders)
authorRobert Griesemer <gri@golang.org>
Mon, 21 Mar 2022 21:37:38 +0000 (14:37 -0700)
committerRobert Griesemer <gri@golang.org>
Mon, 21 Mar 2022 22:33:09 +0000 (22:33 +0000)
Now that the go/types and types2 test files end in .go we must
avoid trying to format them as that won't work in general.

Change-Id: I05fdd95a0d26cbe746f6d618b22b48dc1f1ea749
Reviewed-on: https://go-review.googlesource.com/c/go/+/394295
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

src/cmd/gofmt/long_test.go

index a130874048b689e0a15fbe6ac1fb6435e2620aa9..2ee5174b96f7c12da4f22cfa1da2d0b5bdda5c89 100644 (file)
@@ -114,7 +114,8 @@ func genFilenames(t *testing.T, filenames chan<- string) {
                        t.Error(err)
                        return nil
                }
-               if isGoFile(d) {
+               // don't descend into testdata directories
+               if isGoFile(d) && !strings.Contains(filepath.ToSlash(filename), "/testdata/") {
                        filenames <- filename
                        nfiles++
                }