Skip to content

Commit 7d27045

Browse files
authored
chore: Remove errcheck deprecated configuration (#2082)
#### Summary Fixes https://github.com/cloudquery/plugin-sdk/actions/runs/13367954470/job/37329892347?pr=2080 ---
1 parent 833b19c commit 7d27045

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

.golangci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ run:
55
linters-settings:
66
errcheck:
77
check-blank: false
8-
ignore: fmt:.*,[rR]ead|[wW]rite|[cC]lose,io:Copy
98
gocritic:
109
disabled-checks:
1110
- commentFormatting

docs/markdown.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ func (g *Generator) renderTablesAsMarkdown(dir string) error {
3939
return fmt.Errorf("failed to create file %v: %v", outputPath, err)
4040
}
4141
defer f.Close()
42-
f.WriteString(content)
42+
_, err = f.WriteString(content)
43+
if err != nil {
44+
return fmt.Errorf("failed to write content to file %v: %v", outputPath, err)
45+
}
4346
return nil
4447
}
4548

@@ -76,8 +79,11 @@ func (g *Generator) renderTable(dir string, table *schema.Table) error {
7679
return fmt.Errorf("failed to create file %v: %v", outputPath, err)
7780
}
7881
defer f.Close()
79-
f.WriteString(content)
80-
return f.Close()
82+
_, err = f.WriteString(content)
83+
if err != nil {
84+
return fmt.Errorf("failed to write content to file %v: %v", outputPath, err)
85+
}
86+
return nil
8187
}
8288

8389
func formatMarkdown(s string) string {

helpers/remoteoauth/token_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ func setupMockTokenServer(t *testing.T, responses map[string]string) string {
153153

154154
w.Header().Set("Content-Type", "application/json")
155155
w.WriteHeader(http.StatusOK)
156-
w.Write([]byte(resp))
156+
_, _ = w.Write([]byte(resp))
157157
}))
158158
t.Cleanup(func() {
159159
ts.Close()

schema/testdata.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ func (tg TestDataGenerator) getExampleJSON(colName string, dataType arrow.DataTy
385385
for _, binaryType := range binaryTypes {
386386
if arrow.TypeEqual(dataType, binaryType) {
387387
bytes := make([]byte, 4)
388-
rnd.Read(bytes)
388+
_, _ = rnd.Read(bytes)
389389
return `"` + base64.StdEncoding.EncodeToString(bytes) + `"`
390390
}
391391
}

0 commit comments

Comments
 (0)