From 466b325770dd49a80769d4b0b67f3d6c879bb592 Mon Sep 17 00:00:00 2001 From: Matthias Diester Date: Mon, 2 Sep 2024 15:16:59 +0200 Subject: [PATCH] Fix `golangci-lint` findings Finding: printf: non-constant format string in call to fmt.Errorf (govet) Use `errors.New` instead of `fmt.Errorf` without formatting. Signed-off-by: Matthias Diester --- pkg/shp/cmd/follower/follow.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/shp/cmd/follower/follow.go b/pkg/shp/cmd/follower/follow.go index 3be2d313e..871807106 100644 --- a/pkg/shp/cmd/follower/follow.go +++ b/pkg/shp/cmd/follower/follow.go @@ -3,6 +3,7 @@ package follower import ( "context" "encoding/json" + "errors" "fmt" "strings" "sync" @@ -201,7 +202,7 @@ func (f *Follower) OnEvent(pod *corev1.Pod) error { for _, c := range pod.Status.Conditions { if c.Type == corev1.PodInitialized || c.Type == corev1.ContainersReady { if c.Status == corev1.ConditionUnknown { - return fmt.Errorf(c.Message) + return errors.New(c.Message) } } }