File tree Expand file tree Collapse file tree 3 files changed +149
-138
lines changed
Expand file tree Collapse file tree 3 files changed +149
-138
lines changed Original file line number Diff line number Diff line change 1919 runs-on : ubuntu-latest
2020 steps :
2121 - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
22- - uses : actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34
22+ - uses : actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b
2323 with :
2424 go-version : ${{ matrix.go-version }}
2525 - name : build
3030 runs-on : ubuntu-latest
3131 steps :
3232 - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
33- - uses : golangci/golangci-lint-action@2226d7cb06a077cd73e56eedd38eecad18e5d837
33+ - uses : golangci/golangci-lint-action@1481404843c368bc19ca9406f87d6e0fc97bdcfd
3434 with :
35- version : v1.64.5
35+ version : v2.0,2
Original file line number Diff line number Diff line change 1+ version : " 2"
12linters :
23 enable :
3- - asasalint
4- - asciicheck
5- - bidichk
6- - bodyclose
7- - canonicalheader
8- - containedctx
9- - contextcheck
10- - copyloopvar
11- - decorder
12- - dogsled
13- - dupl
14- - dupword
15- - durationcheck
16- - err113
17- - errcheck
18- - errchkjson
19- - errname
20- - errorlint
21- - exhaustive
22- - exptostd
23- - fatcontext
24- - forcetypeassert
25- - gci
26- - ginkgolinter
27- - gocheckcompilerdirectives
28- - gochecknoinits
29- - gochecksumtype
30- - gocritic
31- - godot
32- - gofmt
33- - gofumpt
34- - goheader
35- - goimports
36- - gomoddirectives
37- - gomodguard
38- - goprintffuncname
39- - gosec
40- - gosimple
41- - gosmopolitan
42- - govet
43- - grouper
44- - iface
45- - importas
46- - inamedparam
47- - ineffassign
48- - interfacebloat
49- - intrange
50- - ireturn
51- - loggercheck
52- - makezero
53- - mirror
54- - misspell
55- - musttag
56- - nakedret
57- - nilerr
58- - nilnesserr
59- - nilnil
60- - noctx
61- - nolintlint
62- - nonamedreturns
63- - nosprintfhostport
64- - perfsprint
65- - prealloc
66- - predeclared
67- - promlinter
68- - protogetter
69- - reassign
70- - recvcheck
71- - revive
72- - rowserrcheck
73- - sloglint
74- - spancheck
75- - sqlclosecheck
76- - staticcheck
77- - stylecheck
78- - tagalign
79- - tagliatelle
80- - testableexamples
81- - testifylint
82- - thelper
83- - tparallel
84- - typecheck
85- - unconvert
86- - unparam
87- - unused
88- - usestdlibvars
89- - usetesting
90- - wastedassign
91- - whitespace
92- - zerologlint
93- disable :
94- - cyclop
95- - depguard
96- - exhaustruct
97- - forbidigo
98- - funlen
99- - gochecknoglobals
100- - gocognit
101- - goconst
102- - gocyclo
103- - godox
104- - lll
105- - maintidx
106- - mnd
107- - nestif
108- - nlreturn
109- - paralleltest
110- - testpackage
111- - varnamelen
112- - wrapcheck
113- - wsl
114-
115- linters-settings :
116- gci :
117- sections :
118- - standard
119- - default
120- - prefix(github.com/twpayne/go-jsonstruct)
121- gofumpt :
122- extra-rules : true
123- module-path : github.com/twpayne/go-jsonstruct
124- goimports :
125- local-prefixes : github.com/twpayne/go-jsonstruct
126-
127- issues :
128- exclude-rules :
129- - linters :
4+ - asasalint
5+ - asciicheck
6+ - bidichk
7+ - bodyclose
8+ - canonicalheader
9+ - containedctx
10+ - contextcheck
11+ - copyloopvar
12+ - decorder
13+ - dogsled
13014 - dupl
131- - scopelint
132- path : " _test\\ .go"
133- - linters :
15+ - dupword
16+ - durationcheck
13417 - err113
135- text : do not define dynamic errors, use wrapped static errors instead
18+ - errchkjson
19+ - errname
20+ - errorlint
21+ - exhaustive
22+ - exptostd
23+ - fatcontext
24+ - forcetypeassert
25+ - ginkgolinter
26+ - gocheckcompilerdirectives
27+ - gochecknoinits
28+ - gochecksumtype
29+ - gocritic
30+ - godot
31+ - goheader
32+ - gomoddirectives
33+ - gomodguard
34+ - goprintffuncname
35+ - gosec
36+ - gosmopolitan
37+ - grouper
38+ - iface
39+ - importas
40+ - inamedparam
41+ - interfacebloat
42+ - intrange
43+ - ireturn
44+ - loggercheck
45+ - makezero
46+ - mirror
47+ - misspell
48+ - musttag
49+ - nakedret
50+ - nilerr
51+ - nilnesserr
52+ - nilnil
53+ - noctx
54+ - nolintlint
55+ - nonamedreturns
56+ - nosprintfhostport
57+ - perfsprint
58+ - prealloc
59+ - predeclared
60+ - promlinter
61+ - protogetter
62+ - reassign
63+ - recvcheck
64+ - revive
65+ - rowserrcheck
66+ - sloglint
67+ - spancheck
68+ - sqlclosecheck
69+ - staticcheck
70+ - tagalign
71+ - tagliatelle
72+ - testableexamples
73+ - testifylint
74+ - thelper
75+ - tparallel
76+ - unconvert
77+ - unparam
78+ - usestdlibvars
79+ - usetesting
80+ - wastedassign
81+ - whitespace
82+ - zerologlint
83+ disable :
84+ - cyclop
85+ - depguard
86+ - exhaustruct
87+ - forbidigo
88+ - funlen
89+ - gochecknoglobals
90+ - gocognit
91+ - goconst
92+ - gocyclo
93+ - godox
94+ - lll
95+ - maintidx
96+ - mnd
97+ - nestif
98+ - nlreturn
99+ - paralleltest
100+ - testpackage
101+ - varnamelen
102+ - wrapcheck
103+ - wsl
104+ exclusions :
105+ generated : lax
106+ presets :
107+ - comments
108+ - common-false-positives
109+ - legacy
110+ - std-error-handling
111+ rules :
112+ - linters :
113+ - dupl
114+ - scopelint
115+ path : _test\.go
116+ - linters :
117+ - err113
118+ text : do not define dynamic errors, use wrapped static errors instead
119+ paths :
120+ - third_party$
121+ - builtin$
122+ - examples$
123+ formatters :
124+ enable :
125+ - gci
126+ - gofmt
127+ - gofumpt
128+ - goimports
129+ settings :
130+ gci :
131+ sections :
132+ - standard
133+ - default
134+ - prefix(github.com/twpayne/go-jsonstruct)
135+ gofumpt :
136+ module-path : github.com/twpayne/go-jsonstruct
137+ extra-rules : true
138+ goimports :
139+ local-prefixes :
140+ - github.com/twpayne/go-jsonstruct
141+ exclusions :
142+ generated : lax
143+ paths :
144+ - third_party$
145+ - builtin$
146+ - examples$
Original file line number Diff line number Diff line change @@ -281,12 +281,12 @@ func (v *value) goType(observations int, options *generateOptions) goType {
281281 }
282282 goType := v .objectProperties [property ].goType (v .objects , options )
283283 var omitEmpty bool
284- switch {
285- case options . omitEmptyTags == OmitEmptyTagsNever :
284+ switch options . omitEmptyTags {
285+ case OmitEmptyTagsNever :
286286 omitEmpty = false
287- case options . omitEmptyTags == OmitEmptyTagsAlways :
287+ case OmitEmptyTagsAlways :
288288 omitEmpty = true
289- case options . omitEmptyTags == OmitEmptyTagsAuto :
289+ case OmitEmptyTagsAuto :
290290 omitEmpty = goType .omitEmpty
291291 }
292292 var omitZero bool
You can’t perform that action at this time.
0 commit comments