mirror of https://github.com/databricks/cli.git
Enable linter 'unconvert' and fix the issues found (#2136)
This commit is contained in:
parent
5d9bc3b553
commit
2b452973f3
|
@ -15,6 +15,7 @@ linters:
|
|||
- intrange
|
||||
- mirror
|
||||
- perfsprint
|
||||
- unconvert
|
||||
linters-settings:
|
||||
govet:
|
||||
enable-all: true
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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"))
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue