commit dd927050d9f00a4a8a46418b4c4980f10556356e Author: Arlo Breault arlolra@gmail.com Date: Thu May 16 12:58:25 2019 -0400
Appease `go vet`s complaints about passing locks by value --- broker/geoip.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/broker/geoip.go b/broker/geoip.go index 16cada1..5a16a8a 100644 --- a/broker/geoip.go +++ b/broker/geoip.go @@ -70,8 +70,8 @@ type GeoIPv6Table struct { lock sync.Mutex // synchronization for geoip table accesses and reloads }
-func (table GeoIPv4Table) Len() int { return len(table.table) } -func (table GeoIPv6Table) Len() int { return len(table.table) } +func (table *GeoIPv4Table) Len() int { return len(table.table) } +func (table *GeoIPv6Table) Len() int { return len(table.table) }
func (table *GeoIPv4Table) Append(entry GeoIPEntry) { (*table).table = append(table.table, entry) @@ -80,8 +80,8 @@ func (table *GeoIPv6Table) Append(entry GeoIPEntry) { (*table).table = append(table.table, entry) }
-func (table GeoIPv4Table) ElementAt(i int) GeoIPEntry { return table.table[i] } -func (table GeoIPv6Table) ElementAt(i int) GeoIPEntry { return table.table[i] } +func (table *GeoIPv4Table) ElementAt(i int) GeoIPEntry { return table.table[i] } +func (table *GeoIPv6Table) ElementAt(i int) GeoIPEntry { return table.table[i] }
func (table *GeoIPv4Table) Lock() { (*table).lock.Lock() } func (table *GeoIPv6Table) Lock() { (*table).lock.Lock() }
tor-commits@lists.torproject.org