dev
This commit is contained in:
parent
b91dfb3eee
commit
3d2b753006
|
@ -0,0 +1,17 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"batch_op_file/util"
|
||||
"fmt"
|
||||
"os"
|
||||
)
|
||||
|
||||
func main() {
|
||||
var paths []string
|
||||
rootDir, _ := os.Getwd()
|
||||
paths, _ = util.GetAllFile(rootDir, paths, []string{".git", ".idea", ".vscode", ".gitignore", ".gitea", ".github", ".golangci.yml", "*.pyc"})
|
||||
|
||||
for _, fp := range paths {
|
||||
fmt.Println(fp)
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package main
|
||||
package util
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
@ -7,16 +7,6 @@ import (
|
|||
"strings"
|
||||
)
|
||||
|
||||
func main() {
|
||||
var paths []string
|
||||
rootDir, _ := os.Getwd()
|
||||
paths, _ = GetAllFile(rootDir, paths, []string{".git", ".idea", ".vscode", ".gitignore", ".gitea", ".github", ".golangci.yml", "*.pyc"})
|
||||
|
||||
for _, fp := range paths {
|
||||
fmt.Println(fp)
|
||||
}
|
||||
}
|
||||
|
||||
func GetAllFile(pathname string, s []string, filter []string) ([]string, error) {
|
||||
rd, err := os.ReadDir(pathname)
|
||||
if err != nil {
|
Loading…
Reference in New Issue