gitee.com/zhongguo168a/gocodes@v0.0.0-20230609140523-e1828349603f/gox/osx/filex/filter_test.go (about) 1 package filex 2 3 import ( 4 "fmt" 5 "regexp" 6 "testing" 7 ) 8 9 func TestFilter_FlushDirPath(t *testing.T) { 10 files := NewFilter(). 11 IgnoreDir(`\..+`). 12 IncludeSuffix(".xlsx"). 13 MatchName(regexp.MustCompile(`^[\w\\u4e00-\\u9fa5]+`)). 14 GetFileInfosByPath("d:/mywork/g2020a/editor-deploy") 15 for _, val := range files { 16 fmt.Println(val.Path()) 17 } 18 }