I\'ve been trying to figure out how to simply list the files and folders in a single directory in Go.
I\'ve found filepath.Walk, but it goes into sub-directories aut
Even simpler, use path/filepath:
path/filepath
package main import ( "fmt" "log" "path/filepath" ) func main() { files, err := filepath.Glob("*") if err != nil { log.Fatal(err) } fmt.Println(files) // contains a list of all files in the current directory }