From 29d0174a544b655647c47ffcc70cbb505c8becf9 Mon Sep 17 00:00:00 2001 From: Alex Boten <223565+codeboten@users.noreply.github.com> Date: Fri, 18 Oct 2024 09:18:14 -0700 Subject: [PATCH] [chore] update test to use Contains (#35875) This follows the recommendations from the new lint version Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com> --- receiver/snmpreceiver/client_test.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/receiver/snmpreceiver/client_test.go b/receiver/snmpreceiver/client_test.go index 8cfb26ad1f09..5bc38d09ad29 100644 --- a/receiver/snmpreceiver/client_test.go +++ b/receiver/snmpreceiver/client_test.go @@ -8,7 +8,6 @@ import ( "fmt" "math" "strconv" - "strings" "testing" "github.com/gosnmp/gosnmp" @@ -83,9 +82,9 @@ func TestNewClient(t *testing.T) { func compareConfigToClient(t *testing.T, client *snmpClient, cfg *Config) { t.Helper() - require.True(t, strings.Contains(cfg.Endpoint, client.client.GetTarget())) - require.True(t, strings.Contains(cfg.Endpoint, strconv.FormatInt(int64(client.client.GetPort()), 10))) - require.True(t, strings.Contains(cfg.Endpoint, client.client.GetTransport())) + require.Contains(t, cfg.Endpoint, client.client.GetTarget()) + require.Contains(t, cfg.Endpoint, strconv.FormatInt(int64(client.client.GetPort()), 10)) + require.Contains(t, cfg.Endpoint, client.client.GetTransport()) switch cfg.Version { case "v1": require.Equal(t, gosnmp.Version1, client.client.GetVersion())