From 9399a8835c27f19f26207dcb96af026e20c0889e Mon Sep 17 00:00:00 2001 From: Andrea Luzzardi Date: Sat, 16 May 2015 17:01:30 -0700 Subject: [PATCH] golint fixes. Signed-off-by: Andrea Luzzardi --- discovery/discovery.go | 19 +++++++++++-------- pkg/store/consul.go | 3 +++ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/discovery/discovery.go b/discovery/discovery.go index 4923b5e800..e9e44adb77 100644 --- a/discovery/discovery.go +++ b/discovery/discovery.go @@ -26,23 +26,26 @@ func NewEntry(url string) (*Entry, error) { } // String returns the string form of an entry. -func (m *Entry) String() string { - return fmt.Sprintf("%s:%s", m.Host, m.Port) +func (e *Entry) String() string { + return fmt.Sprintf("%s:%s", e.Host, e.Port) } -func (a *Entry) Equals(b *Entry) bool { - return a.Host == b.Host && a.Port == b.Port +// Equals returns true if cmp contains the same data. +func (e *Entry) Equals(cmp *Entry) bool { + return e.Host == cmp.Host && e.Port == cmp.Port } +// Entries is a list of *Entry with some helpers. type Entries []*Entry -func (a Entries) Equals(b Entries) bool { +// Equals returns true if cmp contains the same data. +func (e Entries) Equals(cmp Entries) bool { // Check if the file has really changed. - if len(a) != len(b) { + if len(e) != len(cmp) { return false } - for i, _ := range a { - if !a[i].Equals(b[i]) { + for i := range e { + if !e[i].Equals(cmp[i]) { return false } } diff --git a/pkg/store/consul.go b/pkg/store/consul.go index 9932f3cb15..f2696453b1 100644 --- a/pkg/store/consul.go +++ b/pkg/store/consul.go @@ -11,6 +11,9 @@ import ( ) const ( + // DefaultWatchWaitTime is how long we block for at a time to check if the + // watched key has changed. This affects the minimum time it takes to + // cancel a watch. DefaultWatchWaitTime = 15 * time.Second )