Skip to content

Commit 886b2ad

Browse files
committedDec 6, 2022
fix: golang ci
1 parent 6c4ea08 commit 886b2ad

File tree

2 files changed

+6
-30
lines changed

2 files changed

+6
-30
lines changed
 

‎.golangci.yml

+1-30
Original file line numberDiff line numberDiff line change
@@ -12,33 +12,4 @@ linters-settings:
1212
disabled: true
1313

1414
linters:
15-
enable-all: true
16-
disable:
17-
- prealloc
18-
- lll
19-
- dupl
20-
- funlen
21-
- wsl
22-
- gomnd
23-
- unparam
24-
- goerr113
25-
- nestif
26-
- errcheck
27-
- golint
28-
- scopelint
29-
- maligned
30-
- interfacer
31-
- wrapcheck
32-
- varnamelen
33-
- tagliatelle
34-
- exhaustivestruct
35-
- gomoddirectives
36-
- ireturn
37-
- nlreturn
38-
- cyclop
39-
- errorlint
40-
- noctx
41-
- gocognit
42-
- gocyclo
43-
- promlinter
44-
- gochecknoglobals
15+
enable-all: false

‎query.go

+5
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,20 @@ func SendQueryCoinsDetail(baseApi, id string) (types.ReturnData, error) {
1616

1717
req, _ := http.NewRequest("GET", u, nil)
1818
resp, err := client.Do(req)
19+
if err != nil {
20+
return d, err
21+
}
1922

2023
body, err := io.ReadAll(resp.Body)
2124
if err != nil {
2225
return d, err
2326
}
27+
2428
err = json.Unmarshal(body, &d)
2529
if err != nil {
2630
return d, err
2731
}
32+
2833
defer resp.Body.Close()
2934

3035
return d, nil

0 commit comments

Comments
 (0)
Please sign in to comment.