Skip to content

Commit

Permalink
Fix Go 1.11 gofmt formatting errors
Browse files Browse the repository at this point in the history
Change-Id: Ic1b898b2fe1b277f762995ad36dbcc02568a2b19
  • Loading branch information
skriptble committed Sep 6, 2018
1 parent 771435c commit b75c1ad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions core/readpref/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ func WithMaxStaleness(ms time.Duration) Option {
func WithTags(tags ...string) Option {
return func(rp *ReadPref) error {
length := len(tags)
if length < 2 || length % 2 != 0 {
if length < 2 || length%2 != 0 {
return ErrInvalidTagSet
}

tagset := make(tag.Set, 0, length/2)

for i := 1; i < length; i+=2 {
for i := 1; i < length; i += 2 {
tagset = append(tagset, tag.Tag{Name: tags[i-1], Value: tags[i]})
}

Expand Down
8 changes: 4 additions & 4 deletions core/readpref/readpref_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func TestPrimaryPreferred_with_options(t *testing.T) {
ms, set := subject.MaxStaleness()
require.True(set)
require.Equal(time.Duration(10), ms)
require.Equal([]tag.Set{{tag.Tag{Name: "a", Value: "1"},tag.Tag{Name: "b", Value: "2"}}}, subject.TagSets())
require.Equal([]tag.Set{{tag.Tag{Name: "a", Value: "1"}, tag.Tag{Name: "b", Value: "2"}}}, subject.TagSets())
}

func TestSecondaryPreferred(t *testing.T) {
Expand All @@ -70,7 +70,7 @@ func TestSecondaryPreferred_with_options(t *testing.T) {
ms, set := subject.MaxStaleness()
require.True(set)
require.Equal(time.Duration(10), ms)
require.Equal([]tag.Set{{tag.Tag{Name: "a", Value: "1"},tag.Tag{Name: "b", Value: "2"}}}, subject.TagSets())
require.Equal([]tag.Set{{tag.Tag{Name: "a", Value: "1"}, tag.Tag{Name: "b", Value: "2"}}}, subject.TagSets())
}

func TestSecondary(t *testing.T) {
Expand All @@ -94,7 +94,7 @@ func TestSecondary_with_options(t *testing.T) {
ms, set := subject.MaxStaleness()
require.True(set)
require.Equal(time.Duration(10), ms)
require.Equal([]tag.Set{{tag.Tag{Name: "a", Value: "1"},tag.Tag{Name: "b", Value: "2"}}}, subject.TagSets())
require.Equal([]tag.Set{{tag.Tag{Name: "a", Value: "1"}, tag.Tag{Name: "b", Value: "2"}}}, subject.TagSets())
}

func TestNearest(t *testing.T) {
Expand All @@ -118,5 +118,5 @@ func TestNearest_with_options(t *testing.T) {
ms, set := subject.MaxStaleness()
require.True(set)
require.Equal(time.Duration(10), ms)
require.Equal([]tag.Set{{tag.Tag{Name: "a", Value: "1"},tag.Tag{Name: "b", Value: "2"}}}, subject.TagSets())
require.Equal([]tag.Set{{tag.Tag{Name: "a", Value: "1"}, tag.Tag{Name: "b", Value: "2"}}}, subject.TagSets())
}

1 comment on commit b75c1ad

@DerRidda
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gee, this made me set Goland to use go fmt. Sorry about that.

Please sign in to comment.