Skip to content

Commit 1d23ecd

Browse files
build(deps): bump golangci/golangci-lint-action from 6.5.2 to 7.0.0 (#147)
* build(deps): bump golangci/golangci-lint-action from 6.5.2 to 7.0.0 Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 6.5.2 to 7.0.0. - [Release notes](https://github.com/golangci/golangci-lint-action/releases) - [Commits](golangci/golangci-lint-action@55c2c14...1481404) --- updated-dependencies: - dependency-name: golangci/golangci-lint-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> * fix: explicitely drop errors on writer close (errcheck) --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Lucas TESSON <[email protected]>
1 parent d59b75e commit 1d23ecd

File tree

11 files changed

+40
-14
lines changed

11 files changed

+40
-14
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,4 @@ jobs:
7171
go-version-file: 'go.mod'
7272

7373
- name: go-lint
74-
uses: golangci/golangci-lint-action@55c2c1448f86e01eaae002a5a3a9624417608d84 # v6.5.2
74+
uses: golangci/golangci-lint-action@1481404843c368bc19ca9406f87d6e0fc97bdcfd # v7.0.0

api/client.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ func (client *Client) Call(req *http.Request, dst any, opts ...Option) error {
130130
if err != nil {
131131
return err
132132
}
133-
defer res.Body.Close()
133+
defer func() {
134+
_ = res.Body.Close()
135+
}()
134136

135137
// Decode response
136138
resp := Response{

api/export.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ func (client *Client) ExportRaw(params *ExportRawParams, opts ...Option) ([]byte
3838
if err != nil {
3939
return nil, err
4040
}
41-
defer res.Body.Close()
41+
defer func() {
42+
_ = res.Body.Close()
43+
}()
4244

4345
if res.StatusCode != http.StatusOK {
4446
return nil, fmt.Errorf("CTFd responded with unexpected status code: got %d", res.StatusCode)

api/files.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ func (client *Client) GetFileContent(file *File, opts ...Option) ([]byte, error)
9292
if err != nil {
9393
return nil, err
9494
}
95-
defer res.Body.Close()
95+
defer func() {
96+
_ = res.Body.Close()
97+
}()
9698

9799
return io.ReadAll(res.Body)
98100
}
@@ -112,7 +114,9 @@ func encodeMultipart(values map[string]any) (io.Reader, string, error) {
112114
var content []byte
113115
// Avoid closer goleak
114116
if x, ok := v.(io.Closer); ok {
115-
defer x.Close()
117+
defer func() {
118+
_ = x.Close()
119+
}()
116120
}
117121
// Add file content or field
118122
if file, ok := v.(*InputFile); ok {
@@ -152,7 +156,9 @@ func encodeMultipart(values map[string]any) (io.Reader, string, error) {
152156
return nil, "", err
153157
}
154158
}
155-
w.Close()
159+
if err := w.Close(); err != nil {
160+
return nil, "", err
161+
}
156162
return &b, w.FormDataContentType(), nil
157163
}
158164

api/login.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ func (client *Client) Login(params *LoginParams, opts ...Option) error {
3131
if err != nil {
3232
return err
3333
}
34-
defer res.Body.Close()
34+
defer func() {
35+
_ = res.Body.Close()
36+
}()
3537

3638
if res.StatusCode != http.StatusOK {
3739
return fmt.Errorf("CTFd responded with status code %d", res.StatusCode)

api/logout.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ func (client *Client) Logout(opts ...Option) error {
1212
if err != nil {
1313
return err
1414
}
15-
defer res.Body.Close()
15+
defer func() {
16+
_ = res.Body.Close()
17+
}()
1618

1719
if res.StatusCode != http.StatusOK {
1820
return fmt.Errorf("CTFd responded with status code %d", res.StatusCode)

api/notifications.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ func (client *Client) HeadNotifications(params *HeadNotificationsParams, opts ..
8080
if err != nil {
8181
return 0, err
8282
}
83-
defer res.Body.Close()
83+
defer func() {
84+
_ = res.Body.Close()
85+
}()
8486

8587
// Check status code
8688
if res.StatusCode != http.StatusOK {

api/register.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ func (client *Client) Register(params *RegisterParams, opts ...Option) error {
2727
if err != nil {
2828
return err
2929
}
30-
defer res.Body.Close()
30+
defer func() {
31+
_ = res.Body.Close()
32+
}()
3133

3234
if res.StatusCode != http.StatusOK {
3335
return fmt.Errorf("CTFd responded with status code %d, which could be due to email reuse", res.StatusCode)
@@ -39,7 +41,9 @@ func (client *Client) Register(params *RegisterParams, opts ...Option) error {
3941
if err != nil {
4042
return err
4143
}
42-
defer res.Body.Close()
44+
defer func() {
45+
_ = res.Body.Close()
46+
}()
4347

4448
nonce, err := getNonce(res.Body)
4549
if err != nil {

api/reset.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ func (client *Client) Reset(params *ResetParams, opts ...Option) error {
4343
if err != nil {
4444
return errors.Wrap(err, "CTFd responded with error")
4545
}
46-
defer res.Body.Close()
46+
defer func() {
47+
_ = res.Body.Close()
48+
}()
4749

4850
if res.StatusCode != http.StatusOK {
4951
return fmt.Errorf("CTFd responded with status code %d", res.StatusCode)

api/setup.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ func (client *Client) Setup(params *SetupParams, opts ...Option) error {
7474
if err != nil {
7575
return err
7676
}
77-
defer res.Body.Close()
77+
defer func() {
78+
_ = res.Body.Close()
79+
}()
7880

7981
if res.StatusCode != http.StatusOK {
8082
return fmt.Errorf("CTFd responded with status code %d", res.StatusCode)

0 commit comments

Comments
 (0)