From 4bfeedaba8b3ee82b1372a78834bcc7343407689 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Wed, 28 Jun 2017 00:59:06 +0200 Subject: [PATCH] Fix some linter advices Signed-off-by: Knut Ahlers --- cache_filesystem.go | 6 +++--- main.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cache_filesystem.go b/cache_filesystem.go index a5bcb1e..196ffb4 100644 --- a/cache_filesystem.go +++ b/cache_filesystem.go @@ -26,15 +26,15 @@ func filesystemCache(center s2.LatLng, zoom int, marker []marker, x, y int) (io. } buf := new(bytes.Buffer) - if _, err := io.Copy(buf, mapReader); err != nil { + if _, err = io.Copy(buf, mapReader); err != nil { return nil, err } - if err := os.MkdirAll(path.Dir(cacheFileName), 0755); err != nil { + if err = os.MkdirAll(path.Dir(cacheFileName), 0700); err != nil { return nil, err } - if err := ioutil.WriteFile(cacheFileName, buf.Bytes(), 0644); err != nil { + if err = ioutil.WriteFile(cacheFileName, buf.Bytes(), 0644); err != nil { return nil, err } diff --git a/main.go b/main.go index 9846016..7a2fd9c 100644 --- a/main.go +++ b/main.go @@ -91,7 +91,7 @@ func handleMapRequest(res http.ResponseWriter, r *http.Request) { } if mapReader, err = cacheFunc(*center, zoom, markers, x, y); err != nil { - log.Error("Map render failed: %s (Request: %s)", err, r.URL.String()) + log.Errorf("Map render failed: %s (Request: %s)", err, r.URL.String()) http.Error(res, fmt.Sprintf("I experienced difficulties rendering your map: %s", err), http.StatusInternalServerError) return }