Skip to content

Commit

Permalink
some more golangci-lint suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
max-rocket-internet committed Aug 23, 2023
1 parent b9bfaf9 commit 16064a3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/checkup/pods.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func CheckPods(resources *v1.PodList) (results symptoms.SymptomList) {
if !scs.Ready {
if time.Since(pod.Status.StartTime.Time).Minutes() < 3 {
results.Add(symptoms.Symptom{
Message: fmt.Sprintf("container '%s' is not ready but pod started %.1f mins ago", scs.Name, pod.Status.StartTime.Sub(time.Now()).Minutes()),
Message: fmt.Sprintf("container '%s' is not ready but pod started %.1f mins ago", scs.Name, time.Since(pod.Status.StartTime.Time).Minutes()),
Severity: "warning",
ResourceName: pod.Name,
ResourceType: resourceType,
Expand Down
2 changes: 1 addition & 1 deletion pkg/checkup/pods_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func TestCheckPodsBadContainerStatuses(t *testing.T) {
result := CheckPods(&dummyResources)

assert.Len(t, result.Symptoms, 1)
assert.Equal(t, "container 'c1' is not ready but pod started -0.0 mins ago", result.Symptoms[0].Message)
assert.Equal(t, "container 'c1' is not ready but pod started 0.0 mins ago", result.Symptoms[0].Message)
assert.Equal(t, "warning", result.Symptoms[0].Severity)
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/log/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ func Info(message string) {
}

func Error(message string, e error) {
infoLogger.Println(fmt.Sprintf("❗ %s: %s", message, e))
infoLogger.Printf("❗ %s: %s\n", message, e)
}

func Fatal(message string, e error) {
infoLogger.Fatalln(fmt.Sprintf("💣 %s: %s", message, e))
infoLogger.Fatalf("💣 %s: %s\n", message, e)
}

func trimMessage(message string) string {
Expand Down

0 comments on commit 16064a3

Please sign in to comment.