Skip to content

Commit 2f4c7b8

Browse files
committed
Fix linter and testing errors
1 parent 6a351f2 commit 2f4c7b8

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

pkg/agent/ip.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ var (
1818

1919
// fetchAgentIP guesses the non-loopback IP address of the Agent host, according to the
2020
// user-provided configuration:
21-
// - If AgentIP is provided, this value is used whatever is the real IP of the Agent.
22-
// - AgentIPIface specifies which interface this function should look into in order to pickup an address.
23-
// - AgentIPType specifies which type of IP address should the agent pickup ("any" to pickup whichever
24-
// ipv4 or ipv6 address is found first)
21+
// - If AgentIP is provided, this value is used whatever is the real IP of the Agent.
22+
// - AgentIPIface specifies which interface this function should look into in order to pickup an address.
23+
// - AgentIPType specifies which type of IP address should the agent pickup ("any" to pickup whichever
24+
// ipv4 or ipv6 address is found first)
2525
func fetchAgentIP(cfg *Config) (net.IP, error) {
2626
if cfg.AgentIP != "" {
2727
if ip := net.ParseIP(cfg.AgentIP); ip != nil {

pkg/exporter/kafka_proto_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ func TestProtoConversion(t *testing.T) {
5050
require.NoError(t, proto.Unmarshal(wc.messages[0].Value, &r))
5151
assert.EqualValues(t, 3, r.EthProtocol)
5252
assert.EqualValues(t, 1, r.Direction)
53-
assert.EqualValues(t, 0xaabbccddeeff, r.DataLink.SrcMac)
54-
assert.EqualValues(t, 0x112233445566, r.DataLink.DstMac)
55-
assert.EqualValues(t, 0xC0010203 /* 192.1.2.3 */, r.Network.SrcAddr.GetIpv4())
53+
assert.EqualValues(t, uint64(0xaabbccddeeff), r.DataLink.SrcMac)
54+
assert.EqualValues(t, uint64(0x112233445566), r.DataLink.DstMac)
55+
assert.EqualValues(t, uint64(0xC0010203) /* 192.1.2.3 */, r.Network.SrcAddr.GetIpv4())
5656
assert.EqualValues(t, 0x7F030201 /* 127.3.2.1 */, r.Network.DstAddr.GetIpv4())
5757
assert.EqualValues(t, 4321, r.Transport.SrcPort)
5858
assert.EqualValues(t, 1234, r.Transport.DstPort)

pkg/grpc/grpc_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func TestGRPCCommunication(t *testing.T) {
6969
assert.EqualValues(t, 456, r.Bytes)
7070
assert.EqualValues(t, 0x11223344, r.GetNetwork().GetSrcAddr().GetIpv4())
7171
assert.EqualValues(t, 0x55667788, r.GetNetwork().GetDstAddr().GetIpv4())
72-
assert.EqualValues(t, 0xaabbccdd, r.GetAgentIp().GetIpv4())
72+
assert.EqualValues(t, uint64(0xaabbccdd), r.GetAgentIp().GetIpv4())
7373
select {
7474
case rs = <-serverOut:
7575
case <-time.After(timeout):
@@ -80,8 +80,8 @@ func TestGRPCCommunication(t *testing.T) {
8080
assert.EqualValues(t, 789, r.EthProtocol)
8181
assert.EqualValues(t, 101, r.Bytes)
8282
assert.EqualValues(t, 0x44332211, r.GetNetwork().GetSrcAddr().GetIpv4())
83-
assert.EqualValues(t, 0x88776655, r.GetNetwork().GetDstAddr().GetIpv4())
84-
assert.EqualValues(t, 0xddccbbaa, r.GetAgentIp().GetIpv4())
83+
assert.EqualValues(t, uint64(0x88776655), r.GetNetwork().GetDstAddr().GetIpv4())
84+
assert.EqualValues(t, uint64(0xddccbbaa), r.GetAgentIp().GetIpv4())
8585

8686
select {
8787
case rs = <-serverOut:

0 commit comments

Comments
 (0)