diff --git a/src/cmd/compile/internal/syntax/parser_test.go b/src/cmd/compile/internal/syntax/parser_test.go index 3cf55defc774dc..673339d667c180 100644 --- a/src/cmd/compile/internal/syntax/parser_test.go +++ b/src/cmd/compile/internal/syntax/parser_test.go @@ -96,7 +96,7 @@ func walkDirs(t *testing.T, dir string, action func(string)) { } } else if fi.IsDir() && fi.Name() != "testdata" { path := filepath.Join(dir, fi.Name()) - if !strings.HasSuffix(path, "/test") { + if !strings.HasSuffix(path, string(filepath.Separator)+"test") { dirs = append(dirs, path) } }