Skip to content

Commit a6e326a

Browse files
committed
Fix errcheck lint and add doctor to help golden file
1 parent de0754d commit a6e326a

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

acceptance/help/output.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ Postgres
157157

158158
Developer Tools
159159
bundle Declarative Automation Bundles let you express data/AI/analytics projects as code.
160+
doctor Validate your Databricks CLI setup
160161
sync Synchronize a local directory to a workspace directory
161162

162163
Additional Commands:

cmd/doctor/checks.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ func checkNetworkWithHost(cmd *cobra.Command, host string) CheckResult {
268268
}
269269
}
270270
defer resp.Body.Close()
271-
io.Copy(io.Discard, resp.Body)
271+
_, _ = io.Copy(io.Discard, resp.Body)
272272

273273
return CheckResult{
274274
Name: "Network",

cmd/doctor/doctor_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ func TestCheckIdentitySuccess(t *testing.T) {
234234
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
235235
if r.URL.Path == "/api/2.0/preview/scim/v2/Me" {
236236
w.Header().Set("Content-Type", "application/json")
237-
w.Write([]byte(`{"userName": "test@example.com"}`))
237+
_, _ = w.Write([]byte(`{"userName": "test@example.com"}`))
238238
return
239239
}
240240
w.WriteHeader(http.StatusOK)
@@ -446,6 +446,6 @@ func TestNewCommandJSONTrailingNewline(t *testing.T) {
446446

447447
err := cmd.Execute()
448448
require.NoError(t, err)
449-
assert.True(t, buf.Len() > 0)
449+
assert.Positive(t, buf.Len())
450450
assert.Equal(t, byte('\n'), buf.Bytes()[buf.Len()-1])
451451
}

0 commit comments

Comments
 (0)