Skip to content

Commit

Permalink
[lint] Fix minor linter warnings. (hashicorp#361)
Browse files Browse the repository at this point in the history
  • Loading branch information
ttsugriy authored and schristoff committed Aug 29, 2019
1 parent db5ceea commit c53e736
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion configuration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"testing"
)

var sampleConfiguration Configuration = Configuration{
var sampleConfiguration = Configuration{
Servers: []Server{
Server{
Suffrage: Nonvoter,
Expand Down
14 changes: 7 additions & 7 deletions future.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,14 +183,14 @@ type userSnapshotFuture struct {
func (u *userSnapshotFuture) Open() (*SnapshotMeta, io.ReadCloser, error) {
if u.opener == nil {
return nil, nil, fmt.Errorf("no snapshot available")
} else {
// Invalidate the opener so it can't get called multiple times,
// which isn't generally safe.
defer func() {
u.opener = nil
}()
return u.opener()
}

// Invalidate the opener so it can't get called multiple times,
// which isn't generally safe.
defer func() {
u.opener = nil
}()
return u.opener()
}

// userRestoreFuture is used for waiting on a user-triggered restore of an
Expand Down
5 changes: 3 additions & 2 deletions fuzzy/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package fuzzy

import (
"fmt"
"github.com/hashicorp/go-hclog"
"path/filepath"
"time"

"github.com/hashicorp/go-hclog"

"github.com/hashicorp/raft"
rdb "github.com/hashicorp/raft-boltdb"
)
Expand Down Expand Up @@ -49,7 +50,7 @@ func newRaftNode(logger hclog.Logger, tc *transports, h TransportHooks, nodes []
for _, n := range nodes {
c = append(c, raft.Server{Suffrage: raft.Voter, ID: raft.ServerID(n), Address: raft.ServerAddress(n)})
}
configuration := raft.Configuration{c}
configuration := raft.Configuration{Servers: c}
if err := raft.BootstrapCluster(config, store, store, ss, transport, configuration); err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion replication.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func (s *followerReplication) notifyAll(leader bool) {
s.notifyLock.Unlock()

// Submit our votes
for v, _ := range n {
for v := range n {
v.vote(leader)
}
}
Expand Down
2 changes: 1 addition & 1 deletion testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ OUTER:
t.Disconnect(a)
}
} else {
for a, _ := range near {
for a := range near {
t.Disconnect(a)
}
}
Expand Down

0 comments on commit c53e736

Please sign in to comment.