summaryrefslogtreecommitdiff
path: root/internal/server
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2024-05-06 20:36:08 +0300
committerPaul Buetow <paul@buetow.org>2024-05-06 20:36:08 +0300
commit5f208cd20d36b070b04ce1c848411dc5293150b6 (patch)
treebc4945c273bc63cc1970bbebdf9a11c6dfc182fe /internal/server
parent4a68405b9bb6ec2c1b1c00b25b5da5a64cb4f8b6 (diff)
fix lint warnings
Diffstat (limited to 'internal/server')
-rw-r--r--internal/server/health/health.go3
-rw-r--r--internal/server/health/health_test.go8
2 files changed, 6 insertions, 5 deletions
diff --git a/internal/server/health/health.go b/internal/server/health/health.go
index d87bd3d..edc03a0 100644
--- a/internal/server/health/health.go
+++ b/internal/server/health/health.go
@@ -42,12 +42,13 @@ func (a alert) String() string {
type Status struct {
alerts map[string]alert
- mu sync.Mutex
+ mu *sync.Mutex
}
func NewStatus() Status {
return Status{
alerts: make(map[string]alert),
+ mu: &sync.Mutex{},
}
}
diff --git a/internal/server/health/health_test.go b/internal/server/health/health_test.go
index 1723d42..babebff 100644
--- a/internal/server/health/health_test.go
+++ b/internal/server/health/health_test.go
@@ -6,10 +6,10 @@ func TestHealthStatus(t *testing.T) {
t.Parallel()
h := NewStatus()
- h.Set(warning, "fooService", "this is not good")
- h.Set(critical, "barService", "this is not good either")
- h.Set(warning, "bazService", "urgh!")
- h.Set(unknown, "bazService", "don't know what happened here!")
+ h.Set(Warning, "fooService", "this is not good")
+ h.Set(Critical, "barService", "this is not good either")
+ h.Set(Warning, "bazService", "urgh!")
+ h.Set(Unknown, "bazService", "don't know what happened here!")
h.Clear("fooService")
result := h.String()