Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. func GetDirs(filepath string) []string {
  2. fileInfos, err := ioutil.ReadDir(filepath)
  3. if err != nil {
  4. log.Fatal(err)
  5. }
  6.  
  7. res := []string{}
  8. for _, fi := range fileInfos {
  9. if !fi.IsDir() {
  10. continue
  11. }
  12. res = append(res, filepath+"/"+fi.Name())
  13. }
  14. return res
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement