diff options
| author | Paul Buetow <paul@buetow.org> | 2025-06-24 20:24:30 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-06-24 20:24:30 +0300 |
| commit | f96256a46390283bc0cd129154ce71702f2c70a0 (patch) | |
| tree | da4584d93eb2113972f05881723a628f86dead29 /internal | |
| parent | dfb7d859e5abaf48afc5426d5bb85759a69df915 (diff) | |
Fix fmt.Errorf non-constant format string errors in multiple packages
- Fixed fmt.Errorf calls in integrationtests/fileutils.go
- Fixed fmt.Errorf calls in integrationtests-old/fileutils.go
- Fixed fmt.Errorf calls in internal/color/color.go
- Fixed t.Errorf call in internal/mapr/logformat/default_test.go
All tests now pass with Go 1.24's stricter format string requirements.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/color/color.go | 6 | ||||
| -rw-r--r-- | internal/mapr/logformat/default_test.go | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/internal/color/color.go b/internal/color/color.go index 9d0bc2e..aebc9e4 100644 --- a/internal/color/color.go +++ b/internal/color/color.go @@ -86,7 +86,7 @@ func ToFgColor(s string) (FgColor, error) { case "default": return FgDefault, nil default: - return FgDefault, fmt.Errorf("unknown foreground text color '" + s + "'") + return FgDefault, fmt.Errorf("unknown foreground text color '%s'", s) } } @@ -113,7 +113,7 @@ func ToBgColor(s string) (BgColor, error) { case "default": return BgDefault, nil default: - return BgDefault, fmt.Errorf("unknown background text color '" + s + "'") + return BgDefault, fmt.Errorf("unknown background text color '%s'", s) } } @@ -143,6 +143,6 @@ func ToAttribute(s string) (Attribute, error) { case "": return AttrNone, nil default: - return AttrNone, fmt.Errorf("unknown text attribute '" + s + "'") + return AttrNone, fmt.Errorf("unknown text attribute '%s'", s) } } diff --git a/internal/mapr/logformat/default_test.go b/internal/mapr/logformat/default_test.go index 4eae81b..edf238f 100644 --- a/internal/mapr/logformat/default_test.go +++ b/internal/mapr/logformat/default_test.go @@ -88,7 +88,7 @@ func TestDefaultLogFormat(t *testing.T) { fields, err := parser.MakeFields("foozoo=bar|bazbay") if err != nil && err != ErrIgnoreFields { - t.Errorf(err.Error()) + t.Errorf("%s", err.Error()) } if _, ok := fields["foo"]; ok { |
