http: use a method to get local address

And limit its export to testing.
This commit is contained in:
Vincent Bernat
2022-08-21 00:43:47 +02:00
parent 18ee3eac6f
commit 3e3bcbdada
17 changed files with 32 additions and 28 deletions

View File

@@ -31,7 +31,7 @@ func TestServeDocs(t *testing.T) {
_, h, _, _ := NewMock(t, conf)
resp, err := netHTTP.Get(fmt.Sprintf("http://%s/api/v0/console/docs/%s",
h.Address, tc.Path))
h.LocalAddr(), tc.Path))
if err != nil {
t.Fatalf("GET /api/v0/console/docs/%s:\n%+v", tc.Path, err)
}