-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
40 lines (32 loc) · 578 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package main
import (
"flag"
"fmt"
"log"
"os"
slide "github.com/tmickleydoyle/moonwalk/slide"
)
var (
dir string
path string
)
func main() {
flag.StringVar(&dir, "path", "", "starting point")
flag.Parse()
if dir != "" {
path = dir
} else {
path, _ = os.Getwd()
}
err := slide.Slide(path, func(path string, info os.FileInfo, err error) error {
if err != nil {
fmt.Printf("prevent panic by handling failure accessing a path %q: %v\n", path, err)
return err
}
fmt.Printf("%q\n", path)
return nil
})
if err != nil {
log.Println(err)
}
}