Skip to content

Commit

Permalink
fix_return_err_shadowing_by_nil
Browse files Browse the repository at this point in the history
Signed-off-by: youngifif <[email protected]>
  • Loading branch information
youngifif committed Jun 3, 2024
1 parent 51bc613 commit 6a8f9db
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion netboot/netconf.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ func ConfigureInterface(ifname string, netconf *NetConf) (err error) {
return err
}
defer func() {
if cerr := rt.Close(); err != nil {
if cerr := rt.Close(); err == nil {
err = cerr
}
}()
Expand Down
2 changes: 1 addition & 1 deletion netboot/netconf_integ_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func TestConfigureInterface(t *testing.T) {
Name: "IP addr, DNS, and routers",
NetConf: &NetConf{
Addresses: []AddrConf{
AddrConf{IPNet: net.IPNet{IP: net.ParseIP("10.20.30.40")}},
AddrConf{IPNet: net.IPNet{IP: net.ParseIP("10.20.30.41")}},
},
DNSServers: []net.IP{net.ParseIP("8.8.8.8")},
DNSSearchList: []string{"slackware.it"},
Expand Down

0 comments on commit 6a8f9db

Please sign in to comment.