Merge pull request #5011 from xiang90/r_c

raft: fix issues reported by golint
release-3.0
Xiang Li 2016-04-08 11:46:12 -07:00
commit 4997ed36b4
2 changed files with 7 additions and 3 deletions

View File

@ -29,8 +29,6 @@ import (
const None uint64 = 0 const None uint64 = 0
const noLimit = math.MaxUint64 const noLimit = math.MaxUint64
var ErrSnapshotTemporarilyUnavailable = errors.New("snapshot is temporarily unavailable")
// Possible values for StateType. // Possible values for StateType.
const ( const (
StateFollower StateType = iota StateFollower StateType = iota
@ -231,7 +229,7 @@ func newRaft(c *Config) *raft {
} }
r.becomeFollower(r.Term, None) r.becomeFollower(r.Term, None)
nodesStrs := make([]string, 0) var nodesStrs []string
for _, n := range r.nodes() { for _, n := range r.nodes() {
nodesStrs = append(nodesStrs, fmt.Sprintf("%x", n)) nodesStrs = append(nodesStrs, fmt.Sprintf("%x", n))
} }

View File

@ -29,8 +29,14 @@ var ErrCompacted = errors.New("requested index is unavailable due to compaction"
// index is older than the existing snapshot. // index is older than the existing snapshot.
var ErrSnapOutOfDate = errors.New("requested index is older than the existing snapshot") var ErrSnapOutOfDate = errors.New("requested index is older than the existing snapshot")
// ErrUnavailable is returned by Storage interface when the requested log entries
// are unavailable.
var ErrUnavailable = errors.New("requested entry at index is unavailable") var ErrUnavailable = errors.New("requested entry at index is unavailable")
// ErrSnapshotTemporarilyUnavailable is returned by the Storage interface when the required
// snapshot is temporarily unavailable.
var ErrSnapshotTemporarilyUnavailable = errors.New("snapshot is temporarily unavailable")
// Storage is an interface that may be implemented by the application // Storage is an interface that may be implemented by the application
// to retrieve log entries from storage. // to retrieve log entries from storage.
// //