From 1e7f067532651b4817fa2415b257ebb5a38e82e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Do=C4=9Fan=20Can=20Bak=C4=B1r?= Date: Wed, 14 Aug 2024 17:31:26 +0300 Subject: [PATCH] lint fix --- channelutil/clone_join_test.go | 2 +- errkit/helpers.go | 4 ++-- errors/enriched.go | 8 ++++---- exec/executil.go | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/channelutil/clone_join_test.go b/channelutil/clone_join_test.go index e0d021b..37ef21d 100644 --- a/channelutil/clone_join_test.go +++ b/channelutil/clone_join_test.go @@ -62,7 +62,7 @@ func TestCloneCounter(t *testing.T) { cloner := channelutil.NewCloneChannels[struct{}](cloneOpts) err := cloner.Clone(context.TODO(), source, sinks...) if err != nil { - t.Fatalf(err.Error()) + t.Fatalf("%s", err.Error()) } } } diff --git a/errkit/helpers.go b/errkit/helpers.go index c1016a0..d385ad8 100644 --- a/errkit/helpers.go +++ b/errkit/helpers.go @@ -82,7 +82,7 @@ func Wrap(err error, message string) error { } x := &ErrorX{} parseError(x, err) - x.Msgf(message) + x.Msgf("%s", message) return x } @@ -148,7 +148,7 @@ func WithMessage(err error, message string) error { } x := &ErrorX{} parseError(x, err) - x.Msgf(message) + x.Msgf("%s", message) return x } diff --git a/errors/enriched.go b/errors/enriched.go index d463ebb..b7a7b5e 100644 --- a/errors/enriched.go +++ b/errors/enriched.go @@ -66,10 +66,10 @@ func (e *enrichedError) Wrap(err ...error) Error { continue } if ee, ok := v.(*enrichedError); ok { - _ = e.Msgf(ee.errString).WithLevel(ee.Level).WithTag(ee.Tags...) + _ = e.Msgf("%s", ee.errString).WithLevel(ee.Level).WithTag(ee.Tags...) e.StackTrace += ee.StackTrace } else { - _ = e.Msgf(v.Error()) + _ = e.Msgf("%s", v.Error()) } } return e @@ -131,10 +131,10 @@ func NewWithErr(err error) Error { return nil } if ee, ok := err.(*enrichedError); ok { - x := New(ee.errString).WithTag(ee.Tags...).WithLevel(ee.Level) + x := New("%s", ee.errString).WithTag(ee.Tags...).WithLevel(ee.Level) x.(*enrichedError).StackTrace = ee.StackTrace } - return New(err.Error()) + return New("%s", err.Error()) } // NewWithTag creates an error with tag diff --git a/exec/executil.go b/exec/executil.go index 348bf38..867c18f 100644 --- a/exec/executil.go +++ b/exec/executil.go @@ -172,7 +172,7 @@ func RunSafe(cmd ...string) (string, error) { if err := cmdExec.Wait(); err != nil { if _, ok := err.(*exec.ExitError); ok { - adbError = errkit.Append(err, errkit.New(string(errorData)), errkit.New("exit error")) + adbError = errkit.Append(err, errkit.New("%s", string(errorData)), errkit.New("exit error")) outData = errorData } else { return "", errkit.Wrap(err, "process i/o error") @@ -215,7 +215,7 @@ func RunSh(cmd ...string) (string, error) { if err := cmdExec.Wait(); err != nil { if _, ok := err.(*exec.ExitError); ok { - adbError = errkit.Append(err, errkit.New(string(errorData)), errkit.New("exit error")) + adbError = errkit.Append(err, errkit.New("%s", string(errorData)), errkit.New("exit error")) outData = errorData } else { return "", errkit.Wrap(err, "process i/o error") @@ -272,7 +272,7 @@ func RunPS(cmd string) (string, error) { if err := cmdExec.Wait(); err != nil { if _, ok := err.(*exec.ExitError); ok { - adbError = errkit.Append(err, errkit.New(string(errorData)), errkit.New("exit error")) + adbError = errkit.Append(err, errkit.New("%s", string(errorData)), errkit.New("exit error")) outData = errorData } else { return "", errkit.Wrap(err, "process i/o error")