mirror of https://github.com/docker/docs.git
golint fixes.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
parent
ac18ef381d
commit
9399a8835c
|
@ -26,23 +26,26 @@ func NewEntry(url string) (*Entry, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// String returns the string form of an entry.
|
// String returns the string form of an entry.
|
||||||
func (m *Entry) String() string {
|
func (e *Entry) String() string {
|
||||||
return fmt.Sprintf("%s:%s", m.Host, m.Port)
|
return fmt.Sprintf("%s:%s", e.Host, e.Port)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *Entry) Equals(b *Entry) bool {
|
// Equals returns true if cmp contains the same data.
|
||||||
return a.Host == b.Host && a.Port == b.Port
|
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
|
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.
|
// Check if the file has really changed.
|
||||||
if len(a) != len(b) {
|
if len(e) != len(cmp) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
for i, _ := range a {
|
for i := range e {
|
||||||
if !a[i].Equals(b[i]) {
|
if !e[i].Equals(cmp[i]) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,9 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
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
|
DefaultWatchWaitTime = 15 * time.Second
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue