I'm trying to find the contents of files within a folder, so I'm listing what's in the folder then while looping through it I'm trying to read the files.
files, _ := ioutil.ReadDir("documents/")
for _, f := range files {
//fmt.Println(f.Name())
z := "documents/" + f.Name()
fmt.Println(z) // prints out 'documents/*doc name*' recursively
z, err := ioutil.ReadFile(z) // This line throws up the error
The error I get is: test.go:85: cannot assign []byte to z (type string) in multiple assignment
Any help? (This is my first time coding in Go)
Thanks!