diff --git a/go.mod b/go.mod index 8bbfbfc..b742d8f 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ -module replace_google_fonts +module batch_op_file go 1.23.3 diff --git a/print/main.go b/print/main.go new file mode 100644 index 0000000..d5023a8 --- /dev/null +++ b/print/main.go @@ -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) + } +} diff --git a/main.go b/util/main.go similarity index 79% rename from main.go rename to util/main.go index 8076920..1fcd1f4 100644 --- a/main.go +++ b/util/main.go @@ -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 {