From 772128485a7e94932cd18b5e3a78d8cfb273e797 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Wed, 21 Feb 2018 09:23:43 +0100 Subject: Run gofmt -s with Go 1.10 See #4434 --- resource/image_cache.go | 2 +- resource/image_test.go | 2 +- resource/resource.go | 2 +- resource/resource_test.go | 34 +++++++++++++++++----------------- 4 files changed, 20 insertions(+), 20 deletions(-) (limited to 'resource') diff --git a/resource/image_cache.go b/resource/image_cache.go index 250155db1..a1d41ec38 100644 --- a/resource/image_cache.go +++ b/resource/image_cache.go @@ -42,7 +42,7 @@ func (c *imageCache) isInCache(key string) bool { func (c *imageCache) deleteByPrefix(prefix string) { c.mu.Lock() defer c.mu.Unlock() - for k, _ := range c.store { + for k := range c.store { if strings.HasPrefix(k, prefix) { delete(c.store, k) } diff --git a/resource/image_test.go b/resource/image_test.go index 1a937d56b..03cd1726f 100644 --- a/resource/image_test.go +++ b/resource/image_test.go @@ -244,7 +244,7 @@ func TestImageWithMetadata(t *testing.T) { image := fetchSunset(assert) var meta = []map[string]interface{}{ - map[string]interface{}{ + { "title": "My Sunset", "name": "Sunset #:counter", "src": "*.jpg", diff --git a/resource/resource.go b/resource/resource.go index 66fda4c1b..67aed39c2 100644 --- a/resource/resource.go +++ b/resource/resource.go @@ -332,7 +332,7 @@ func (r *Spec) CacheStats() string { s := fmt.Sprintf("Cache entries: %d", len(r.imageCache.store)) count := 0 - for k, _ := range r.imageCache.store { + for k := range r.imageCache.store { if count > 5 { break } diff --git a/resource/resource_test.go b/resource/resource_test.go index 1ff979846..f4c652d43 100644 --- a/resource/resource_test.go +++ b/resource/resource_test.go @@ -198,7 +198,7 @@ func TestAssignMetadata(t *testing.T) { assertFunc func(err error) }{ {[]map[string]interface{}{ - map[string]interface{}{ + { "title": "My Resource", "name": "My Name", "src": "*", @@ -210,11 +210,11 @@ func TestAssignMetadata(t *testing.T) { }}, {[]map[string]interface{}{ - map[string]interface{}{ + { "title": "My Logo", "src": "*loGo*", }, - map[string]interface{}{ + { "title": "My Resource", "name": "My Name", "src": "*", @@ -229,7 +229,7 @@ func TestAssignMetadata(t *testing.T) { }}, {[]map[string]interface{}{ - map[string]interface{}{ + { "title": "My Logo", "src": "*loGo*", "params": map[string]interface{}{ @@ -237,7 +237,7 @@ func TestAssignMetadata(t *testing.T) { "icon": "logo", }, }, - map[string]interface{}{ + { "title": "My Resource", "src": "*", "params": map[string]interface{}{ @@ -269,11 +269,11 @@ func TestAssignMetadata(t *testing.T) { }}, {[]map[string]interface{}{ - map[string]interface{}{ + { "name": "Logo Name #:counter", "src": "*logo*", }, - map[string]interface{}{ + { "title": "Resource #:counter", "name": "Name #:counter", "src": "*", @@ -293,11 +293,11 @@ func TestAssignMetadata(t *testing.T) { }}, {[]map[string]interface{}{ - map[string]interface{}{ + { "title": "Third Logo #:counter", "src": "logo3.png", }, - map[string]interface{}{ + { "title": "Other Logo #:counter", "name": "Name #:counter", "src": "logo*", @@ -313,11 +313,11 @@ func TestAssignMetadata(t *testing.T) { }}, {[]map[string]interface{}{ - map[string]interface{}{ + { "title": "Third Logo", "src": "logo3.png", }, - map[string]interface{}{ + { "title": "Other Logo #:counter", "name": "Name #:counter", "src": "logo*", @@ -333,11 +333,11 @@ func TestAssignMetadata(t *testing.T) { }}, {[]map[string]interface{}{ - map[string]interface{}{ + { "name": "third-logo", "src": "logo3.png", }, - map[string]interface{}{ + { "title": "Logo #:counter", "name": "Name #:counter", "src": "logo*", @@ -353,7 +353,7 @@ func TestAssignMetadata(t *testing.T) { }}, {[]map[string]interface{}{ - map[string]interface{}{ + { "title": "Third Logo #:counter", }, }, func(err error) { @@ -362,7 +362,7 @@ func TestAssignMetadata(t *testing.T) { }}, {[]map[string]interface{}{ - map[string]interface{}{ + { "title": "Title", "src": "[]", }, @@ -469,12 +469,12 @@ func BenchmarkAssignMetadata(b *testing.B) { b.StopTimer() var resources Resources var meta = []map[string]interface{}{ - map[string]interface{}{ + { "title": "Foo #:counter", "name": "Foo Name #:counter", "src": "foo1*", }, - map[string]interface{}{ + { "title": "Rest #:counter", "name": "Rest Name #:counter", "src": "*", -- cgit v1.2.3