Skip to content

Instantly share code, notes, and snippets.

@will3942
Created December 4, 2013 21:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save will3942/7795487 to your computer and use it in GitHub Desktop.
Save will3942/7795487 to your computer and use it in GitHub Desktop.
Go: looping through files in a directory
a := []Post{}
files, _ := filepath.Glob("posts/*")
for _, f := range files {
file := strings.Replace(f, "posts/", "", -1)
file = strings.Replace(file, ".md", "", -1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment