From 2c4734184c2ae62c9839c8674d966757a54e263c Mon Sep 17 00:00:00 2001 From: Kevin Franklin Kim Date: Mon, 11 Sep 2023 14:09:37 +0200 Subject: [PATCH] feat: add check --- service/http_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/service/http_test.go b/service/http_test.go index 8146d33..22331bb 100644 --- a/service/http_test.go +++ b/service/http_test.go @@ -2,7 +2,9 @@ package service_test import ( "io" + "net" "net/http" + "time" "github.com/foomo/keel" "github.com/foomo/keel/service" @@ -24,6 +26,9 @@ func ExampleNewHTTP() { ) go func() { + if _, err := net.DialTimeout("tcp", "localhost:8080", 10*time.Second); err != nil { + panic(err.Error()) + } resp, _ := http.Get("http://localhost:8080") //nolint:noctx defer resp.Body.Close() //nolint:govet b, _ := io.ReadAll(resp.Body)