Skip to content

Commit

Permalink
web: fix golangci-lint errors (i-core#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolaas committed Nov 17, 2020
1 parent e9feb0b commit 428b9bc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions internal/web/web.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ func (r *HTMLRenderer) RenderTemplate(w http.ResponseWriter, req *http.Request,
}

if isOldStyleUserTemplate(root) {
wrapper, err := r.mainTmpl.Clone()
var wrapper *template.Template
wrapper, err = r.mainTmpl.Clone()
if err != nil {
return errors.Wrapf(err, "failed to clone the main template for template %q: %s", name, err)
}
Expand All @@ -120,7 +121,9 @@ func (r *HTMLRenderer) RenderTemplate(w http.ResponseWriter, req *http.Request,

var langPrefs []langPref
if acceptLang := req.Header.Get(http.CanonicalHeaderKey("Accept-Language")); acceptLang != "" {
tags, weights, err := language.ParseAcceptLanguage(acceptLang)
var tags []language.Tag
var weights []float32
tags, weights, err = language.ParseAcceptLanguage(acceptLang)
if err != nil {
return errors.Wrapf(err, "failed to parse the header \"Accept-Language\": %s", err)
}
Expand Down

0 comments on commit 428b9bc

Please sign in to comment.