Documentation
¶
Overview ¶
Package find implements search funcs for finding files by name or content
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Matcher ¶
func NewShellPattern ¶
type Result ¶ added in v0.2.0
func ByName ¶
ByName returns a list of files whose names match the shell like pattern
Example ¶
package main
import (
"fmt"
"os"
"github.com/gregoryv/find"
)
var testRoot string
func main() {
os.Chdir(testRoot)
result, _ := find.ByName("*.txt", ".")
for e := result.Front(); e != nil; e = e.Next() {
if s, ok := e.Value.(string); ok {
fmt.Println(s)
}
}
}
Output: a.txt b.txt
Click to show internal directories.
Click to hide internal directories.
