Skip to content

Instantly share code, notes, and snippets.

@will3942
Created December 4, 2013 21:03
Show Gist options
  • Save will3942/7795495 to your computer and use it in GitHub Desktop.
Save will3942/7795495 to your computer and use it in GitHub Desktop.
Go: read file and get values
fileread, _ := ioutil.ReadFile(f)
lines := strings.Split(string(fileread), "\n")
title := string(lines[0])
date := string(lines[1])
summary := string(lines[2])
body := strings.Join(lines[3:len(lines)], "\n")
body = string(blackfriday.MarkdownCommon([]byte(body)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment