Remove redundant constructor, h/t sergio

This commit is contained in:
Pim van Pelt
2025-11-15 22:41:57 +01:00
parent 27c7a5bcae
commit a0d5c61643
12 changed files with 48 additions and 44 deletions

View File

@@ -45,4 +45,4 @@ func StartAgentXRoutine(interfaceMIB *ifmib.InterfaceMIB) error {
logger.Printf("Successfully registered with AgentX at %s://%s", network, address)
return nil
}
}

View File

@@ -22,7 +22,7 @@ func TestAgentXAddrFlagParsing(t *testing.T) {
// Test Unix socket path
testAddr := "/var/run/test.sock"
*AgentXAddr = testAddr
if *AgentXAddr != testAddr {
t.Errorf("Expected AgentX address to be '%s', got '%s'", testAddr, *AgentXAddr)
}
@@ -30,7 +30,7 @@ func TestAgentXAddrFlagParsing(t *testing.T) {
// Test TCP address
testAddr = "192.168.1.1:705"
*AgentXAddr = testAddr
if *AgentXAddr != testAddr {
t.Errorf("Expected AgentX address to be '%s', got '%s'", testAddr, *AgentXAddr)
}
@@ -43,12 +43,12 @@ func TestFlagRegistration(t *testing.T) {
t.Error("Expected agentx.addr flag to be registered")
return
}
if f.DefValue != "localhost:705" {
t.Errorf("Expected flag default value to be 'localhost:705', got '%s'", f.DefValue)
}
if f.Usage != "Address to connect to (hostname:port or Unix socket path)" {
t.Errorf("Unexpected flag usage string: %s", f.Usage)
}
}
}