add goSec, go-lint, update actions #2

Merged
lerentis merged 4 commits from add-gosec-scan into main 2025-10-09 15:47:41 +00:00
Showing only changes of commit d3467b357f - Show all commits

View File

@@ -4,6 +4,7 @@ import (
"net/http"
"strings"
"testing"
"time"
)
func TestHealth(t *testing.T) {
@@ -11,14 +12,19 @@ func TestHealth(t *testing.T) {
go func() {
hs.Start()
}()
// Give the server time to start up
time.Sleep(100 * time.Millisecond)
request, _ := http.NewRequest(http.MethodGet, "http://localhost:8080/health", strings.NewReader(""))
resp, err := http.DefaultClient.Do(request)
if err != nil {
t.Errorf("Health endpoint did not start: %v", err)
return
}
if resp.StatusCode != http.StatusOK {
if resp != nil && resp.StatusCode != http.StatusOK {
t.Errorf("Bad response from health endpoint. Want: %d, got %d", http.StatusOK, resp.StatusCode)
}
}