Debian Codegraph @

example_unix_test.go

raw
1 //go:build !windows && !plan9
2
3 package locafero
4
5 import (
6 "fmt"
7
8 "github.com/spf13/afero"
9 )
10
11 func ExampleFinder_Find() {
12 fsys := afero.NewBasePathFs(afero.NewOsFs(), "testdata")
13
14 finder := Finder{
15 Paths: []string{
16 "/home/user",
17 "/etc",
18 },
19 Names: []string{"config.*"},
20 Type: FileTypeFile,
21 }
22
23 results, err := finder.Find(fsys)
24 if err != nil {
25 panic(err)
26 }
27
28 fmt.Println("On Unix:", results)
29
30 // Output:
31 // On Unix: [/home/user/config.yaml /etc/config.yaml]
32 }