Last active
August 24, 2018 21:26
-
-
Save kmaher9/33ffd0f52e08a81635261ed5e0edc9d2 to your computer and use it in GitHub Desktop.
This file contains 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
func enumerateDirectory(location string) []string { | |
var files []string | |
listing, err := ioutil.ReadDir(location) | |
if err != nil { | |
panic(err) | |
} | |
for _, l := range listing { | |
files = append(files, location+"/"+l.Name()) | |
} | |
return files | |
} | |
func readFile(location string) string { | |
file, err := ioutil.ReadFile(location) | |
if err != nil { | |
panic(err) | |
} | |
return string(file) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment