buffalo/cmd/fix/middleware.go
func onlyRelevantFiles(p string, fi os.FileInfo, err error, fn func(p string) error) error {
	if err != nil {
		return err
	}

	if fi.IsDir() {
		base := filepath.Base(p)
		if strings.HasPrefix(base, "_") {
			return filepath.SkipDir
		}
		for _, n := range []string{"vendor", "node_modules", ".git"} {
			if base == n {
				return filepath.SkipDir
			}
		}
		return nil
	}

	ext := filepath.Ext(p)
	if ext != ".go" {
		return nil
	}

	return fn(p)
}
func onlyRelevantFiles(p string, fi os.FileInfo, err error, fn func(p string) error) error {
	if err != nil {
		return err
	}

	if fi.IsDir() {
		base := filepath.Base(p)
		if strings.HasPrefix(base, "_") {
			return filepath.SkipDir
		}
		for _, n := range []string{"vendor", "node_modules", ".git"} {
			if base == n {
				return filepath.SkipDir
			}
		}
		return nil
	}

	ext := filepath.Ext(p)
	if ext != ".go" {
		return nil
	}

	return fn(p)
}
func onlyRelevantFiles ( p string , fi os . FileInfo , err error , fn func ( p string ) error ) error { if err != nil { return err } if fi . IsDir ( ) { base := filepath . Base ( p ) if strings . HasPrefix ( base , " " ) { return filepath . SkipDir } for _ , n := range [ ] string { " " , " " , " " } { if base == n { return filepath . SkipDir } } return nil } ext := filepath . Ext ( p ) if ext != " " { return nil } return fn ( p ) }
//onlyRelevantFiles processes only .go files excluding folders like node_modules and vendor.
onlyRelevantFiles processes only . go files excluding folders like node_modules and vendor .