Created
March 18, 2015 23:40
-
-
Save lettergram/7a1c9a4f3914cf05e5c3 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
type Page struct { | |
Title string | |
Body template.HTML | |
UserData template.HTML | |
Bar template.HTML | |
} | |
// Loads a page for use | |
func loadPage(title string, r *http.Request) (*Page, error) { | |
filename, option, usr, bar := user.LoadUserInfo(title, r) | |
body, err := ioutil.ReadFile(filename) | |
if err != nil { | |
return nil, err | |
} | |
return &Page{Title: title, Body: template.HTML(body), UserData: (template.HTML(usr) + template.HTML(option)), Bar: template.HTML(bar)}, nil | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment