Created
January 9, 2017 06:18
-
-
Save juwencheng/05b827d4927f72c42ba8590ecc6e3be4 to your computer and use it in GitHub Desktop.
example of filepath.Walk function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"os" | |
"path/filepath" | |
) | |
func main() { | |
walfFn := func(path string, info os.FileInfo, err error) error { | |
fmt.Println(path, info.Name()) | |
return nil | |
} | |
filepath.Walk("../getosinfo/", walfFn) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment