Created
July 25, 2019 16:34
-
-
Save MasterGroosha/03f9a2be3e2231a6478d207943d81dcb to your computer and use it in GitHub Desktop.
Test go files renamer with padding
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"os" | |
"path/filepath" | |
) | |
const ( | |
DirPath = "D:\\test" | |
) | |
func main() { | |
var files []string | |
err := filepath.Walk(DirPath, func(path string, info os.FileInfo, err error) error { | |
if !info.IsDir() { | |
files = append(files, path) | |
} | |
return nil | |
}) | |
if err != nil { | |
panic(err) | |
} | |
for _, file := range files { | |
fmt.Println(file) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment