You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
303 B
26 lines
303 B
2 years ago
|
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())
|
||
|
}
|
||
|
|
||
|
}
|