diff --git a/agentx/agentx_test.go b/agentx/agentx_test.go index bc3b805..34eb4dc 100644 --- a/agentx/agentx_test.go +++ b/agentx/agentx_test.go @@ -41,6 +41,7 @@ func TestFlagRegistration(t *testing.T) { f := flag.Lookup("agentx.addr") if f == nil { t.Error("Expected agentx.addr flag to be registered") + return } if f.DefValue != "localhost:705" { diff --git a/ifmib/ifmib.go b/ifmib/ifmib.go index 4ad514c..fc836b6 100644 --- a/ifmib/ifmib.go +++ b/ifmib/ifmib.go @@ -4,7 +4,7 @@ package ifmib import ( "fmt" - "io/ioutil" + "os" "sync" "time" @@ -102,7 +102,7 @@ func (m *InterfaceMIB) LoadVPPConfig(configPath string) error { defer m.mutex.Unlock() // Read YAML file - data, err := ioutil.ReadFile(configPath) + data, err := os.ReadFile(configPath) if err != nil { return fmt.Errorf("failed to read VPP config file: %v", err) } diff --git a/logger/logger_test.go b/logger/logger_test.go index 393e145..90dad94 100644 --- a/logger/logger_test.go +++ b/logger/logger_test.go @@ -26,7 +26,7 @@ func TestPrintf(t *testing.T) { // Read captured output var buf bytes.Buffer - io.Copy(&buf, r) + _, _ = io.Copy(&buf, r) output := buf.String() // Check output format: "INFO file.go:function message" @@ -64,7 +64,7 @@ func TestDebugfWithDebugEnabled(t *testing.T) { // Read captured output var buf bytes.Buffer - io.Copy(&buf, r) + _, _ = io.Copy(&buf, r) output := buf.String() // Check output format: "DEBUG file.go:function message" @@ -98,7 +98,7 @@ func TestDebugfWithDebugDisabled(t *testing.T) { // Read captured output var buf bytes.Buffer - io.Copy(&buf, r) + _, _ = io.Copy(&buf, r) output := buf.String() // Should be empty when debug is disabled diff --git a/vppstats/stats.go b/vppstats/stats.go index 9a5015b..ba5433c 100644 --- a/vppstats/stats.go +++ b/vppstats/stats.go @@ -142,10 +142,7 @@ func statsRoutine(period time.Duration, callback StatsCallback) { } // Wait for next tick - select { - case <-ticker.C: - continue - } + <-ticker.C } }