From 2fbc053d6fb342845e037ab0084a5790d9f9d743 Mon Sep 17 00:00:00 2001 From: hwipl <33433250+hwipl@users.noreply.github.com> Date: Fri, 5 Apr 2024 18:16:26 +0200 Subject: [PATCH 1/2] Fix linter warnings Signed-off-by: hwipl <33433250+hwipl@users.noreply.github.com> --- internal/https/server_test.go | 2 +- pkg/tnd/detector_test.go | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/internal/https/server_test.go b/internal/https/server_test.go index af13a85..9383e9f 100644 --- a/internal/https/server_test.go +++ b/internal/https/server_test.go @@ -14,7 +14,7 @@ import ( func TestServerCheck(t *testing.T) { // start test https server ts := httptest.NewTLSServer(http.HandlerFunc( - func(w http.ResponseWriter, r *http.Request) {})) + func(http.ResponseWriter, *http.Request) {})) defer ts.Close() // test invalid server diff --git a/pkg/tnd/detector_test.go b/pkg/tnd/detector_test.go index 0b64723..69831fb 100644 --- a/pkg/tnd/detector_test.go +++ b/pkg/tnd/detector_test.go @@ -10,6 +10,8 @@ import ( "reflect" "testing" "time" + + log "github.com/sirupsen/logrus" ) // testWatcher is a watcher that implements the routes.Watcher and @@ -55,7 +57,7 @@ func TestDetectorSetGetDialer(t *testing.T) { func TestDetectorProbe(t *testing.T) { // start test https server ts := httptest.NewTLSServer(http.HandlerFunc( - func(w http.ResponseWriter, r *http.Request) {})) + func(http.ResponseWriter, *http.Request) {})) defer ts.Close() // create detector @@ -117,7 +119,8 @@ func TestDetectorHandleProbeResult(t *testing.T) { // drain results channel go func() { - for range tnd.results { + for r := range tnd.results { + log.Println("result:", r) } }() From 2ac79b4dfb22d4f02b151a8c2940f17b773d3ad4 Mon Sep 17 00:00:00 2001 From: hwipl <33433250+hwipl@users.noreply.github.com> Date: Fri, 5 Apr 2024 18:24:31 +0200 Subject: [PATCH 2/2] Update package comment in TND example Signed-off-by: hwipl <33433250+hwipl@users.noreply.github.com> --- examples/tnd/main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/tnd/main.go b/examples/tnd/main.go index 8f49203..cee99c7 100644 --- a/examples/tnd/main.go +++ b/examples/tnd/main.go @@ -1,4 +1,6 @@ -// package main contains a TND example. +/* +Tnd is a TND example. +*/ package main import (