Fix golangci-lint issues
This commit is contained in:
@ -41,6 +41,7 @@ func TestFlagRegistration(t *testing.T) {
|
|||||||
f := flag.Lookup("agentx.addr")
|
f := flag.Lookup("agentx.addr")
|
||||||
if f == nil {
|
if f == nil {
|
||||||
t.Error("Expected agentx.addr flag to be registered")
|
t.Error("Expected agentx.addr flag to be registered")
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if f.DefValue != "localhost:705" {
|
if f.DefValue != "localhost:705" {
|
||||||
|
@ -4,7 +4,7 @@ package ifmib
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"os"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -102,7 +102,7 @@ func (m *InterfaceMIB) LoadVPPConfig(configPath string) error {
|
|||||||
defer m.mutex.Unlock()
|
defer m.mutex.Unlock()
|
||||||
|
|
||||||
// Read YAML file
|
// Read YAML file
|
||||||
data, err := ioutil.ReadFile(configPath)
|
data, err := os.ReadFile(configPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to read VPP config file: %v", err)
|
return fmt.Errorf("failed to read VPP config file: %v", err)
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ func TestPrintf(t *testing.T) {
|
|||||||
|
|
||||||
// Read captured output
|
// Read captured output
|
||||||
var buf bytes.Buffer
|
var buf bytes.Buffer
|
||||||
io.Copy(&buf, r)
|
_, _ = io.Copy(&buf, r)
|
||||||
output := buf.String()
|
output := buf.String()
|
||||||
|
|
||||||
// Check output format: "INFO file.go:function message"
|
// Check output format: "INFO file.go:function message"
|
||||||
@ -64,7 +64,7 @@ func TestDebugfWithDebugEnabled(t *testing.T) {
|
|||||||
|
|
||||||
// Read captured output
|
// Read captured output
|
||||||
var buf bytes.Buffer
|
var buf bytes.Buffer
|
||||||
io.Copy(&buf, r)
|
_, _ = io.Copy(&buf, r)
|
||||||
output := buf.String()
|
output := buf.String()
|
||||||
|
|
||||||
// Check output format: "DEBUG file.go:function message"
|
// Check output format: "DEBUG file.go:function message"
|
||||||
@ -98,7 +98,7 @@ func TestDebugfWithDebugDisabled(t *testing.T) {
|
|||||||
|
|
||||||
// Read captured output
|
// Read captured output
|
||||||
var buf bytes.Buffer
|
var buf bytes.Buffer
|
||||||
io.Copy(&buf, r)
|
_, _ = io.Copy(&buf, r)
|
||||||
output := buf.String()
|
output := buf.String()
|
||||||
|
|
||||||
// Should be empty when debug is disabled
|
// Should be empty when debug is disabled
|
||||||
|
@ -142,10 +142,7 @@ func statsRoutine(period time.Duration, callback StatsCallback) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Wait for next tick
|
// Wait for next tick
|
||||||
select {
|
<-ticker.C
|
||||||
case <-ticker.C:
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user