Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.