Skip to content

Instantly share code, notes, and snippets.

@juwencheng
Created January 9, 2017 06:18
Show Gist options
  • Save juwencheng/05b827d4927f72c42ba8590ecc6e3be4 to your computer and use it in GitHub Desktop.
Save juwencheng/05b827d4927f72c42ba8590ecc6e3be4 to your computer and use it in GitHub Desktop.
example of filepath.Walk function
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