summaryrefslogtreecommitdiff
path: root/internal/test
diff options
context:
space:
mode:
authorJeroen Wijenbergh <jeroen.wijenbergh@geant.org>2025-05-06 12:35:21 +0200
committerJeroen Wijenbergh <jeroen.wijenbergh@geant.org>2025-05-06 12:35:21 +0200
commit9c4985368aee638d982f30ea7bc5c7ee71ae3ab3 (patch)
tree10b0bd88547c366b05404419b9e7dee1b1a1e270 /internal/test
parentcd4e5a23852ca5f9af7f66f1daa9dfbf7d8e7376 (diff)
All: Fix staticcheck errors
Diffstat (limited to 'internal/test')
-rw-r--r--internal/test/server.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/internal/test/server.go b/internal/test/server.go
index 1abbd8c..f222abc 100644
--- a/internal/test/server.go
+++ b/internal/test/server.go
@@ -24,12 +24,14 @@ func NewServer(handler http.Handler, listener net.Listener) *Server {
}
s := httptest.NewUnstartedServer(handler)
- s.Listener.Close()
+ // This is only for tests and if this fails, bad luck
+ s.Listener.Close() //nolint:errcheck
s.Listener = listener
s.StartTLS()
return &Server{s}
}
+// HandlerPath handles a specific HTTP query
type HandlerPath struct {
Method string
Path string
@@ -38,6 +40,7 @@ type HandlerPath struct {
ResponseCode int
}
+// HandlerFunc handles a HTTP request
func (hp *HandlerPath) HandlerFunc() func(http.ResponseWriter, *http.Request) {
if hp.ResponseHandler != nil {
return hp.ResponseHandler