I am new to the Go language and trying to learn.
I made a program to walk through a directory. It worked fine but when I try to run the program in a go routine it returns:
filepath.Walk() returned 0xc08402f180
my function is this:
func LoadData(root string) {
runtime.GOMAXPROCS(runtime.NumCPU())
c := make(chan error)
go func() {c<-filepath.Walk(root, WalkFunc)}()
if erw := c; erw != nil {
fmt.Printf("filepath.Walk() returned %v
", erw)
// log.Fatal(erw)
}
}
How can I solve this problem?
Thanks.