Enable linter 'unconvert' and fix the issues found (#2136)

This commit is contained in:
Denis Bilenko 2025-01-14 11:56:38 +01:00 committed by GitHub
parent 5d9bc3b553
commit 2b452973f3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 5 additions and 4 deletions

View File

@ -15,6 +15,7 @@ linters:
- intrange
- mirror
- perfsprint
- unconvert
linters-settings:
govet:
enable-all: true

View File

@ -44,6 +44,6 @@ func TestAppInterpolateVariables(t *testing.T) {
diags := bundle.Apply(context.Background(), b, InterpolateVariables())
require.Empty(t, diags)
require.Equal(t, []any([]any{map[string]any{"name": "JOB_ID", "value": "123"}}), b.Config.Resources.Apps["my_app_1"].Config["env"])
require.Equal(t, []any{map[string]any{"name": "JOB_ID", "value": "123"}}, b.Config.Resources.Apps["my_app_1"].Config["env"])
require.Nil(t, b.Config.Resources.Apps["my_app_2"].Config)
}

View File

@ -189,7 +189,7 @@ func (l *Logger) writeJson(event Event) {
// we panic because there we cannot catch this in jobs.RunNowAndWait
panic(err)
}
_, _ = l.Writer.Write([]byte(b))
_, _ = l.Writer.Write(b)
_, _ = l.Writer.Write([]byte("\n"))
}

View File

@ -81,7 +81,7 @@ func (v Value) AsInt() (int64, bool) {
case int32:
return int64(vv), true
case int64:
return int64(vv), true
return vv, true
default:
return 0, false
}

View File

@ -47,7 +47,7 @@ func (f file) close() error {
func (f file) readHeader() (string, error) {
// Scan header line with some padding.
buf := make([]byte, headerLength)
n, err := f.f.Read([]byte(buf))
n, err := f.f.Read(buf)
if err != nil && err != io.EOF {
return "", err
}