plugin: cleanup code based on staticcheck warnings (#3302)

TrimPrefix re-assign to former variable

Signed-off-by: Guangming Wang <guangming.wang@daocloud.io>
This commit is contained in:
Guangming Wang
2019-09-25 20:23:43 +08:00
committed by Miek Gieben
parent 47719756fe
commit eb59e79207
5 changed files with 6 additions and 10 deletions

View File

@@ -244,8 +244,8 @@ func (h *Hostsfile) LookupStaticAddr(addr string) []string {
h.RLock()
defer h.RUnlock()
hosts1, _ := h.hmap.addr[addr]
hosts2, _ := h.inline.addr[addr]
hosts1 := h.hmap.addr[addr]
hosts2 := h.inline.addr[addr]
if len(hosts1) == 0 && len(hosts2) == 0 {
return nil