Skip to content

Commit

Permalink
filepath.Glob()学习
Browse files Browse the repository at this point in the history
  • Loading branch information
kuuyee committed Dec 3, 2015
1 parent 2db526e commit 9f24917
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
13 changes: 13 additions & 0 deletions path/filepath/abc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package main

import (
"fmt"
"path/filepath"
)

func main() {
m, _ := filepath.Glob("*.go")
for i, v := range m {
fmt.Println(i, v) //0 abs.go 1 base.go 2 fromslash.go 3 glob.go
}
}
13 changes: 13 additions & 0 deletions path/filepath/glob.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package main

import (
"fmt"
"path/filepath"
)

func main() {
matches, _ := filepath.Glob("*.go")
for i, v := range matches {
fmt.Println(i, v)
}
}

0 comments on commit 9f24917

Please sign in to comment.