“ [HTTP] http:多个响应。WriteHeader调用”错误

I'm trying to set up a simple blog using the Beego framework, however my function for displaying blog posts brings up the error "[HTTP] http: multiple response.WriteHeader calls"

It's definitely the "loadPost" function, because without it the application works fine.

func (this *BlogController) GetBlog() {
    this.Data["PostName"] = this.Ctx.Input.Param(":id")
    p, err := loadPost(this.Ctx.Input.Param(":id"))
    if err != nil {
        fmt.Println(err)
    }
    this.Data["Website"] = "Blog"
    this.Data["Title"] = p.Title
    this.Data["Body"] = p.Body
    this.TplName = "blog/blog-postview.tpl"
}

and the loadPost func:

func loadPost(title string) (*BlogPost, error) {
    filename := "views/blog/posts/" + title + ".json"
    body, err := ioutil.ReadFile(filename)
    if err != nil {
        return nil, err
    }
    var blogpost BlogPost
    json.Unmarshal([]byte(body), &blogpost)
    return &BlogPost{Title: title, Body: blogpost.Body}, nil
}

The "GetBlog" router takes in the "id" parameter from the URL, then inputs it into the loadPost() function, where the loadPost() function then finds the .json file matching the "id" parameter and puts it into a struct named "BlogPost", which is then returned to the GetBlog() function and that stores the values where the template can access it. However, when using this code I get a runtime error which shows the error code in the title of this post. What am I doing wrong here?