From b5f39d23b86f9cb83c51da9fe4abb4c19c01c3b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Sun, 24 Mar 2019 10:11:16 +0100 Subject: all: Apply staticcheck recommendations --- tpl/data/resources.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tpl/data/resources.go') diff --git a/tpl/data/resources.go b/tpl/data/resources.go index 8b246a662..7de440ca6 100644 --- a/tpl/data/resources.go +++ b/tpl/data/resources.go @@ -34,7 +34,7 @@ var ( ) // getRemote loads the content of a remote file. This method is thread safe. -func (ns *Namespace) getRemote(cache *filecache.Cache, unmarshal func([]byte) (error, bool), req *http.Request) error { +func (ns *Namespace) getRemote(cache *filecache.Cache, unmarshal func([]byte) (bool, error), req *http.Request) error { url := req.URL.String() id := helpers.MD5String(url) var handled bool @@ -63,7 +63,7 @@ func (ns *Namespace) getRemote(cache *filecache.Cache, unmarshal func([]byte) (e } res.Body.Close() - err, retry = unmarshal(b) + retry, err = unmarshal(b) if err == nil { // Return it so it can be cached. @@ -85,7 +85,7 @@ func (ns *Namespace) getRemote(cache *filecache.Cache, unmarshal func([]byte) (e if !handled { // This is cached content and should be correct. - err, _ = unmarshal(b) + _, err = unmarshal(b) } return err @@ -104,14 +104,14 @@ func getLocal(url string, fs afero.Fs, cfg config.Provider) ([]byte, error) { // getResource loads the content of a local or remote file and returns its content and the // cache ID used, if relevant. -func (ns *Namespace) getResource(cache *filecache.Cache, unmarshal func(b []byte) (error, bool), req *http.Request) error { +func (ns *Namespace) getResource(cache *filecache.Cache, unmarshal func(b []byte) (bool, error), req *http.Request) error { switch req.URL.Scheme { case "": b, err := getLocal(req.URL.String(), ns.deps.Fs.Source, ns.deps.Cfg) if err != nil { return err } - err, _ = unmarshal(b) + _, err = unmarshal(b) return err default: return ns.getRemote(cache, unmarshal, req) -- cgit v1.2.3