From 931ef9482b4d7d66a9e42fe702fa367d90c971ae Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Mon, 4 Oct 2021 14:17:05 +0100 Subject: [PATCH] Add checks to see if we can fetch the ip from map, remove possible null assignment --- integration_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/integration_test.go b/integration_test.go index 7e75089d..30703d63 100644 --- a/integration_test.go +++ b/integration_test.go @@ -345,15 +345,16 @@ func (s *IntegrationTestSuite) TestGetIpAddresses() { for hostname := range scales.tailscales { s.T().Run(hostname, func(t *testing.T) { - ip := ips[hostname] + ip, ok := ips[hostname] + + assert.True(t, ok) + assert.NotNil(t, ip) fmt.Printf("IP for %s: %s\n", hostname, ip) // c.Assert(ip.Valid(), check.IsTrue) assert.True(t, ip.Is4()) assert.True(t, ipPrefix.Contains(ip)) - - ips[hostname] = ip }) } }