File tree Expand file tree Collapse file tree 3 files changed +13
-22
lines changed
Expand file tree Collapse file tree 3 files changed +13
-22
lines changed Original file line number Diff line number Diff line change 2222 uses : golangci/golangci-lint-action@v4
2323 with :
2424 version : latest
25- args : --config=.golangci.yml -v --timeout 10m
25+ args : --config=.golangci.yml -v --timeout 1m
Original file line number Diff line number Diff line change 11linters :
2- # disable-all: true
32 enable :
43 - gofumpt
54 - durationcheck
65 - forcetypeassert
7- # TODO: そのうち入れたいlinterのオプション
8- # - gocognit
9- # - goconst
10- # - gocritic
11- # - disabled-checks:
12- # - captLocal
13- # - gochecknoglobals
14- # - errorlint
15- # - exhaustive
16- # - funlen
6+ - gocognit
7+ - goconst
8+ - gocritic
9+ - gochecknoglobals
10+ - errorlint
11+ - exhaustive
1712issues :
1813 max-same-issues : 0
19- exclude-rules :
20- # Exclude some linters from running on tests files.
21- - path : _test\.go
22- linters :
23- - forcetypeassert
Original file line number Diff line number Diff line change @@ -228,17 +228,18 @@ func (e *endpoints) generateOpenApiSchema(config OpenApiGeneratorConfig) (openap
228228 item = paths [path ]
229229 }
230230
231- if api .Method == http .MethodGet {
231+ switch api .Method {
232+ case http .MethodGet :
232233 item .Get = & operation
233- } else if api . Method == http .MethodPost {
234+ case http .MethodPost :
234235 item .Post = & operation
235236 operation .RequestBody = & requestBodyAny
236- } else if api . Method == http .MethodPut {
237+ case http .MethodPut :
237238 item .Put = & operation
238239 operation .RequestBody = & requestBodyAny
239- } else if api . Method == http .MethodDelete {
240+ case http .MethodDelete :
240241 item .Delete = & operation
241- } else if api . Method == http .MethodPatch {
242+ case http .MethodPatch :
242243 item .Patch = & operation
243244 operation .RequestBody = & requestBodyAny
244245 }
You can’t perform that action at this time.
0 commit comments