From 0888d28260820a41f6083a2e2a308aef8fb27b3c Mon Sep 17 00:00:00 2001 From: mpl Date: Fri, 17 Aug 2018 02:17:54 +0200 Subject: [PATCH] all: fix misc bugs found with go test ./... Change-Id: If5bda860c9cc6bdc14c2977646516c58d17d62de --- dev/devcam/review.go | 4 +- pkg/client/client.go | 2 +- server/perkeepd/ui/goui/geo/geo_test.go | 57 ------------------------- 3 files changed, 3 insertions(+), 60 deletions(-) delete mode 100644 server/perkeepd/ui/goui/geo/geo_test.go diff --git a/dev/devcam/review.go b/dev/devcam/review.go index 239cd58a0..6acea546a 100644 --- a/dev/devcam/review.go +++ b/dev/devcam/review.go @@ -145,14 +145,14 @@ func checkOrigin() { func setPushOrigin() { out, err := exec.Command("git", "remote", "set-url", "--push", "origin", newOrigin).CombinedOutput() if err != nil { - log.Fatal("%v, %s", err, out) + log.Fatalf("%v, %s", err, out) } } func setFetchOrigin() { out, err := exec.Command("git", "remote", "set-url", "origin", newOrigin).CombinedOutput() if err != nil { - log.Fatal("%v, %s", err, out) + log.Fatalf("%v, %s", err, out) } } diff --git a/pkg/client/client.go b/pkg/client/client.go index d2a8647da..bb0b924ae 100644 --- a/pkg/client/client.go +++ b/pkg/client/client.go @@ -524,7 +524,7 @@ func (c *Client) SetHaveCache(cache HaveCache) { func (c *Client) printf(format string, v ...interface{}) { if c.Verbose && c.Logger != nil { - c.Logger.Printf(format, v) + c.Logger.Printf(format, v...) } } diff --git a/server/perkeepd/ui/goui/geo/geo_test.go b/server/perkeepd/ui/goui/geo/geo_test.go deleted file mode 100644 index 7c88118c8..000000000 --- a/server/perkeepd/ui/goui/geo/geo_test.go +++ /dev/null @@ -1,57 +0,0 @@ -/* -Copyright 2017 The Perkeep Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package geo - -import ( - "testing" -) - -func TestWrapAntimeridian(t *testing.T) { - tt := []struct { - east, newEast, west, newWest float64 - }{ - { - // Should wrap around +180 - east: -160., - west: 50., - newEast: 200., - newWest: 50., - }, - { - // Should wrap around -180 - east: -10., - west: 150., - newEast: -10., - newWest: -210., - }, - { - // Should do nothing - east: 40., - west: -60., - newEast: 40., - newWest: -60., - }, - } - - for k, v := range tt { - eastWest := WrapAntimeridian(v.east, v.west) - if v.newEast != eastWest.E || v.newWest != eastWest.W { - t.Errorf("at test %d, got [%v, %v], wanted [%v, %v]", k, v.newEast, v.newWest, eastWest.E, eastWest.W) - } - } - -}