]> Cypherpunks.ru repositories - gostls13.git/blobdiff - test/winbatch.go
cmd/compile/internal/inline: score call sites exposed by inlines
[gostls13.git] / test / winbatch.go
index c3b48d385cecc8bd1dd4ddfa5e1a8b1377750283..54c2fff13463bdf3a51bbb1ea3a321d37bc26f1e 100644 (file)
@@ -27,11 +27,11 @@ func main() {
        // Walk the entire Go repository source tree (without GOROOT/pkg),
        // skipping directories that start with "." and named "testdata",
        // and ensure all .bat files found have exact CRLF line endings.
-       err := filepath.Walk(runtime.GOROOT(), func(path string, fi os.FileInfo, err error) error {
+       err := filepath.WalkDir(runtime.GOROOT(), func(path string, d os.DirEntry, err error) error {
                if err != nil {
                        return err
                }
-               if fi.IsDir() && (strings.HasPrefix(fi.Name(), ".") || fi.Name() == "testdata") {
+               if d.IsDir() && (strings.HasPrefix(d.Name(), ".") || d.Name() == "testdata") {
                        return filepath.SkipDir
                }
                if path == filepath.Join(runtime.GOROOT(), "pkg") {
@@ -39,7 +39,7 @@ func main() {
                        // Skip it to avoid false positives. (Also see golang.org/issue/37929.)
                        return filepath.SkipDir
                }
-               if filepath.Ext(fi.Name()) == ".bat" {
+               if filepath.Ext(d.Name()) == ".bat" {
                        enforceBatchStrictCRLF(path)
                }
                return nil