Skip to content

Instantly share code, notes, and snippets.

@kmaher9
Last active August 24, 2018 21:26
Show Gist options
  • Save kmaher9/33ffd0f52e08a81635261ed5e0edc9d2 to your computer and use it in GitHub Desktop.
Save kmaher9/33ffd0f52e08a81635261ed5e0edc9d2 to your computer and use it in GitHub Desktop.
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