From 428b9bc5371ebffa2a7a413cfa3e3b36257c60b5 Mon Sep 17 00:00:00 2001 From: Nikolay Stupak Date: Tue, 17 Nov 2020 17:15:10 +0000 Subject: [PATCH] web: fix golangci-lint errors (#11) --- internal/web/web.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/web/web.go b/internal/web/web.go index c6ce5d5..5c56336 100644 --- a/internal/web/web.go +++ b/internal/web/web.go @@ -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) } @@ -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) }