diff options
author | Pablo Mazzini <pmazzini@gmail.com> | 2022-08-20 20:50:51 +0100 |
---|---|---|
committer | Pablo Mazzini <pmazzini@gmail.com> | 2022-08-20 20:50:51 +0100 |
commit | 9a5f3bbb33dc6fa4e4eb35a702a5fc72feb35dc8 (patch) | |
tree | 4531eb502fcc973f0e8238be451ad5bbd48559d3 | |
parent | 2a691a334f6a296f8be54357782002165dcdaa33 (diff) |
[dhcpv4][client] fix lint
-rw-r--r-- | dhcpv4/client4/client.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/dhcpv4/client4/client.go b/dhcpv4/client4/client.go index f274714..253bf28 100644 --- a/dhcpv4/client4/client.go +++ b/dhcpv4/client4/client.go @@ -7,7 +7,6 @@ import ( "fmt" "log" "net" - "reflect" "time" "github.com/insomniacslk/dhcp/dhcpv4" @@ -145,10 +144,10 @@ func toUDPAddr(addr net.Addr, defaultAddr *net.UDPAddr) (*net.UDPAddr, error) { if addr == nil { uaddr = defaultAddr } else { - if addr, ok := addr.(*net.UDPAddr); ok { - uaddr = addr + if a, ok := addr.(*net.UDPAddr); ok { + uaddr = a } else { - return nil, fmt.Errorf("could not convert to net.UDPAddr, got %v instead", reflect.TypeOf(addr)) + return nil, fmt.Errorf("could not convert to net.UDPAddr, got %T instead", addr) } } if uaddr.IP.To4() == nil { |