Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is this an error? return nil, when err != nil #6

Open
groob opened this issue May 23, 2015 · 0 comments
Open

Is this an error? return nil, when err != nil #6

groob opened this issue May 23, 2015 · 0 comments

Comments

@groob
Copy link

groob commented May 23, 2015

https://github.com/codegangsta/essential-go/blob/master/pub/pages/page.go#L40

func (p *Page) load() error {
    c, err := LoadConfig("config.json")
    if err != nil {
        return err
    }

    data, err := ioutil.ReadFile(p.File)
    if err != nil {
        return nil
    }

    p.HTML = string(blackfriday.MarkdownCommon(data))
    p.Title = c.Name()
    p.Author = c.Author()
    return nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant