1
0
Fork 0
mirror of https://github.com/Luzifer/staticmap.git synced 2024-12-20 21:01:18 +00:00

Fix some linter advices

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2017-06-28 00:59:06 +02:00
parent e597231825
commit 4bfeedaba8
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E
2 changed files with 4 additions and 4 deletions

View file

@ -26,15 +26,15 @@ func filesystemCache(center s2.LatLng, zoom int, marker []marker, x, y int) (io.
} }
buf := new(bytes.Buffer) buf := new(bytes.Buffer)
if _, err := io.Copy(buf, mapReader); err != nil { if _, err = io.Copy(buf, mapReader); err != nil {
return nil, err 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 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 return nil, err
} }

View file

@ -91,7 +91,7 @@ func handleMapRequest(res http.ResponseWriter, r *http.Request) {
} }
if mapReader, err = cacheFunc(*center, zoom, markers, x, y); err != nil { 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) http.Error(res, fmt.Sprintf("I experienced difficulties rendering your map: %s", err), http.StatusInternalServerError)
return return
} }