-
Notifications
You must be signed in to change notification settings - Fork 0
/
pkg.go
54 lines (49 loc) · 968 Bytes
/
pkg.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package forgot
import (
"fmt"
// "github.com/shaalx/sstruct"
"io/ioutil"
)
func niil() {
fmt.Println("...")
}
func ListDirs(dir string, suf string) {
finfos, err := ioutil.ReadDir(dir)
if nil != err {
fmt.Println(err)
return
}
for _, info := range finfos {
if info.IsDir() {
fmt.Println("---------------------------------/", info.Name())
if ".git" == info.Name() {
continue
}
ListDirs(suf+"/"+info.Name(), suf+"/"+info.Name())
}
fmt.Println(info.Name())
}
}
/*
func TestPath(t *testing.T) {
// os.Chdir("./pkg3/httplib")
cwd, err := os.Getwd()
if err != nil {
t.Fatal(err)
}
t.Log(cwd)
dir := filepath.Dir(cwd)
t.Log(dir)
filepath.Walk(cwd, walk)
}
// down into the sub dirs
func walk(filepath string, info os.FileInfo, err error) error {
if info.IsDir() {
if ".git" == info.Name() {
return nil
}
// fmt.Println(info.Name(), "---------------------")
}
// fmt.Println(filepath, info.Name())
return nil
}*/