From 3bdfa9b050dbb910c2639ea6323db1027b8a3bb2 Mon Sep 17 00:00:00 2001 From: Alvaro Saurin Date: Mon, 27 Apr 2015 11:38:51 +0200 Subject: [PATCH] Make lint happy --- nameserver/cache.go | 4 ++-- nameserver/mocks_test.go | 21 ++++++++++++--------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/nameserver/cache.go b/nameserver/cache.go index 4e788c41..644814f0 100644 --- a/nameserver/cache.go +++ b/nameserver/cache.go @@ -371,7 +371,7 @@ func (c *Cache) Len() int { } // Return the max capacity -func (c Cache) Capacity() int { +func (c *Cache) Capacity() int { c.lock.RLock() defer c.lock.RUnlock() @@ -379,7 +379,7 @@ func (c Cache) Capacity() int { } // Return the max capacity -func (c Cache) String() string { +func (c *Cache) String() string { c.lock.RLock() defer c.lock.RUnlock() diff --git a/nameserver/mocks_test.go b/nameserver/mocks_test.go index b5fe7393..89c05884 100644 --- a/nameserver/mocks_test.go +++ b/nameserver/mocks_test.go @@ -28,7 +28,7 @@ type mockedZoneWithRecords struct { func newMockedZoneWithRecords(zr []ZoneRecord) *mockedZoneWithRecords { return &mockedZoneWithRecords{records: zr} } -func (mz mockedZoneWithRecords) Domain() string { return DefaultLocalDomain } +func (mz *mockedZoneWithRecords) Domain() string { return DefaultLocalDomain } func (mz *mockedZoneWithRecords) LookupName(name string) ([]ZoneRecord, error) { Debug.Printf("[mocked zone]: LookupName: returning records %s", mz.records) mz.Lock() @@ -63,26 +63,29 @@ func (mz *mockedZoneWithRecords) LookupInaddr(inaddr string) ([]ZoneRecord, erro return res, nil } -func (mz mockedZoneWithRecords) DomainLookupName(name string) ([]ZoneRecord, error) { +func (mz *mockedZoneWithRecords) DomainLookupName(name string) ([]ZoneRecord, error) { return mz.LookupName(name) } -func (mz mockedZoneWithRecords) DomainLookupInaddr(inaddr string) ([]ZoneRecord, error) { +func (mz *mockedZoneWithRecords) DomainLookupInaddr(inaddr string) ([]ZoneRecord, error) { return mz.LookupInaddr(inaddr) } // the following methods are not currently needed... -func (mz mockedZoneWithRecords) AddRecord(ident string, name string, ip net.IP) error { +func (mz *mockedZoneWithRecords) AddRecord(ident string, name string, ip net.IP) error { notImplWarn() return nil } -func (mz mockedZoneWithRecords) DeleteRecord(ident string, ip net.IP) error { notImplWarn(); return nil } -func (mz mockedZoneWithRecords) DeleteRecordsFor(ident string) error { notImplWarn(); return nil } -func (mz mockedZoneWithRecords) Status() string { notImplWarn(); return "nothing" } -func (mz mockedZoneWithRecords) ObserveName(name string, observer ZoneRecordObserver) error { +func (mz *mockedZoneWithRecords) DeleteRecord(ident string, ip net.IP) error { notImplWarn() return nil } -func (mz mockedZoneWithRecords) ObserveInaddr(inaddr string, observer ZoneRecordObserver) error { +func (mz *mockedZoneWithRecords) DeleteRecordsFor(ident string) error { notImplWarn(); return nil } +func (mz *mockedZoneWithRecords) Status() string { notImplWarn(); return "nothing" } +func (mz *mockedZoneWithRecords) ObserveName(name string, observer ZoneRecordObserver) error { + notImplWarn() + return nil +} +func (mz *mockedZoneWithRecords) ObserveInaddr(inaddr string, observer ZoneRecordObserver) error { notImplWarn() return nil }