go-sh-manymanuals/exp/ls.go

26 lines
303 B
Go
Raw Normal View History

2022-04-20 12:59:33 +02:00
package main
import (
"fmt"
"io/ioutil"
"log"
"path/filepath"
)
func main() {
fpath, err := filepath.Abs("./files")
if err != nil {
log.Fatalln(err)
}
files, err := ioutil.ReadDir(fpath)
if err != nil {
log.Fatalln(err)
}
for _, file := range files {
fmt.Println(file.Name())
}
}