lint fix: staticcheck and null derefs
This commit is contained in:
@ -14,6 +14,7 @@ func TestNewInterfaceMIB(t *testing.T) {
|
|||||||
|
|
||||||
if mib == nil {
|
if mib == nil {
|
||||||
t.Fatal("NewInterfaceMIB returned nil")
|
t.Fatal("NewInterfaceMIB returned nil")
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if mib.handler == nil {
|
if mib.handler == nil {
|
||||||
|
@ -15,6 +15,7 @@ func TestNewInterfaceManager(t *testing.T) {
|
|||||||
|
|
||||||
if manager == nil {
|
if manager == nil {
|
||||||
t.Fatal("NewInterfaceManager() returned nil")
|
t.Fatal("NewInterfaceManager() returned nil")
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if manager.client != client {
|
if manager.client != client {
|
||||||
@ -32,7 +33,6 @@ func TestNewInterfaceManager(t *testing.T) {
|
|||||||
if manager.watchingEvents {
|
if manager.watchingEvents {
|
||||||
t.Error("InterfaceManager should not be watching events initially")
|
t.Error("InterfaceManager should not be watching events initially")
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestInterfaceManagerSetEventCallback(t *testing.T) {
|
func TestInterfaceManagerSetEventCallback(t *testing.T) {
|
||||||
|
@ -15,6 +15,7 @@ func TestNewStatsManager(t *testing.T) {
|
|||||||
|
|
||||||
if manager == nil {
|
if manager == nil {
|
||||||
t.Fatal("NewStatsManager() returned nil")
|
t.Fatal("NewStatsManager() returned nil")
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if manager.client != client {
|
if manager.client != client {
|
||||||
|
Reference in New Issue
Block a user