From 28d7d9587e88470c9a2733358d2dc9ca9d0526a0 Mon Sep 17 00:00:00 2001 From: Florian Lehner Date: Tue, 20 Feb 2024 21:54:01 +0100 Subject: [PATCH] stub server v2: set target from listener (#100) Instead of the unspecified IP address use the Addr() from Listener to set the value of target. Signed-off-by: Florian Lehner --- pkg/client/mock/stub_serverV2.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/client/mock/stub_serverV2.go b/pkg/client/mock/stub_serverV2.go index 889988f..df15e20 100644 --- a/pkg/client/mock/stub_serverV2.go +++ b/pkg/client/mock/stub_serverV2.go @@ -82,7 +82,7 @@ func (s *StubServerV2) listen(opt ...grpc.ServerOption) (lis net.Listener, clean return nil, nil, err } s.Port = lis.Addr().(*net.TCPAddr).Port - s.target = fmt.Sprintf(":%d", s.Port) + s.target = lis.Addr().String() return lis, cleanup, nil }