Skip to content

Commit 8d056d1

Browse files
committed
Lint
1 parent 2122d53 commit 8d056d1

4 files changed

Lines changed: 14 additions & 14 deletions

File tree

go/database_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ import (
2424

2525
func TestParseURIForStaging(t *testing.T) {
2626
tests := []struct {
27-
name string
28-
uri string
29-
wantHost string
30-
wantPort int
31-
wantToken string
32-
wantErr bool
27+
name string
28+
uri string
29+
wantHost string
30+
wantPort int
31+
wantToken string
32+
wantErr bool
3333
}{
3434
{
3535
name: "standard URI with token",
@@ -89,7 +89,7 @@ func TestStagingOptionsWithURI(t *testing.T) {
8989

9090
// Staging options should be allowed alongside URI
9191
err := d.SetOptions(map[string]string{
92-
adbc.OptionKeyURI: "databricks://token:mytoken@host.com:443/path",
92+
adbc.OptionKeyURI: "databricks://token:mytoken@host.com:443/path",
9393
OptionStagingVolumePath: "cat.sch.vol",
9494
OptionStagingPrefix: "my_prefix",
9595
})

go/staging_client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ func (c *stagingClient) uploadToURL(ctx context.Context, url string, data io.Rea
9292
if err != nil {
9393
return fmt.Errorf("upload request failed: %w", err)
9494
}
95-
defer resp.Body.Close()
95+
defer func() { _ = resp.Body.Close() }()
9696

9797
if resp.StatusCode < 200 || resp.StatusCode >= 300 {
9898
body, _ := io.ReadAll(resp.Body)
@@ -119,7 +119,7 @@ func (c *stagingClient) deleteFromURL(ctx context.Context, url string) error {
119119
if err != nil {
120120
return fmt.Errorf("delete request failed: %w", err)
121121
}
122-
defer resp.Body.Close()
122+
defer func() { _ = resp.Body.Close() }()
123123

124124
if resp.StatusCode < 200 || resp.StatusCode >= 300 {
125125
body, _ := io.ReadAll(resp.Body)

go/staging_client_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ func TestUpload(t *testing.T) {
179179

180180
resp, err := c.httpClient.Do(req)
181181
require.NoError(t, err)
182-
defer resp.Body.Close()
182+
defer func() { _ = resp.Body.Close() }()
183183

184184
assert.Equal(t, http.StatusOK, resp.StatusCode)
185185
assert.Equal(t, http.MethodPut, receivedMethod)
@@ -192,7 +192,7 @@ func TestUpload(t *testing.T) {
192192
t.Run("upload failure", func(t *testing.T) {
193193
server := httptest.NewTLSServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
194194
w.WriteHeader(http.StatusForbidden)
195-
w.Write([]byte(`{"error": "access denied"}`))
195+
_, _ = w.Write([]byte(`{"error": "access denied"}`))
196196
}))
197197
defer server.Close()
198198

@@ -236,7 +236,7 @@ func TestDelete(t *testing.T) {
236236
t.Run("delete failure", func(t *testing.T) {
237237
server := httptest.NewTLSServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
238238
w.WriteHeader(http.StatusNotFound)
239-
w.Write([]byte(`{"error": "not found"}`))
239+
_, _ = w.Write([]byte(`{"error": "not found"}`))
240240
}))
241241
defer server.Close()
242242

go/statement.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,15 +196,15 @@ func (s *statementImpl) executeBulkIngest(ctx context.Context) (int64, error) {
196196
options: &s.bulkIngestOptions,
197197
}
198198

199-
alloc := s.conn.ConnectionImplBase.Alloc
199+
alloc := s.conn.Alloc
200200
if alloc == nil {
201201
alloc = memory.DefaultAllocator
202202
}
203203

204204
mgr := &driverbase.BulkIngestManager{
205205
Impl: impl,
206206
ErrorHelper: &s.ErrorHelper,
207-
Logger: s.conn.ConnectionImplBase.Logger,
207+
Logger: s.conn.Logger,
208208
Alloc: alloc,
209209
Ctx: ctx,
210210
Options: s.bulkIngestOptions,

0 commit comments

Comments
 (0)