Skip to content

Commit 409be37

Browse files
Merge pull request #21 from marten-seemann/linters
run gofumpt, add a few more linters
2 parents 3e91963 + 9b4bf02 commit 409be37

File tree

5 files changed

+37
-23
lines changed

5 files changed

+37
-23
lines changed

.github/workflows/golangci-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ jobs:
1616
uses: golangci/golangci-lint-action@v1
1717
with:
1818
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
19-
version: v1.30
19+
version: v1.32

.golangci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,13 @@ linters-settings:
33
linters:
44
disable-all: true
55
enable:
6+
- asciicheck
67
- deadcode
8+
- exhaustive
9+
- exportloopref
710
- goconst
8-
- gofmt
11+
- gofmt # redundant, since gofmt *should* be a no-op after gofumpt
12+
- gofumpt
913
- goimports
1014
- gosimple
1115
- ineffassign

encoder.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ func (e *Encoder) WriteField(f HeaderField) error {
4747
e.writeLiteralFieldWithNameReference(&f, idxAndVals.idx)
4848
}
4949
}
50-
5150
} else {
5251
e.writeLiteralFieldWithoutNameReference(f)
5352
}

integrationtests/interop/interop_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ func currentDir() string {
2424
}
2525

2626
var _ = Describe("Interop", func() {
27-
2827
// find all encoded files with a dynamic table size of 0
2928
findFiles := func() []string {
3029
var files []string

static_table.go

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,12 @@ var encoderMap = map[string]indexAndValues{
142142
"HEAD": 18,
143143
"OPTIONS": 19,
144144
"POST": 20,
145-
"PUT": 21}},
145+
"PUT": 21,
146+
}},
146147
":scheme": {22, map[string]uint8{
147148
"http": 22,
148-
"https": 23}},
149+
"https": 23,
150+
}},
149151
":status": {24, map[string]uint8{
150152
"103": 24,
151153
"200": 25,
@@ -160,27 +162,32 @@ var encoderMap = map[string]indexAndValues{
160162
"403": 68,
161163
"421": 69,
162164
"425": 70,
163-
"500": 71}},
165+
"500": 71,
166+
}},
164167
"accept": {29, map[string]uint8{
165168
"*/*": 29,
166-
"application/dns-message": 30}},
169+
"application/dns-message": 30,
170+
}},
167171
"accept-encoding": {31, map[string]uint8{"gzip, deflate, br": 31}},
168172
"accept-ranges": {32, map[string]uint8{"bytes": 32}},
169173
"access-control-allow-headers": {33, map[string]uint8{
170174
"cache-control": 33,
171175
"content-type": 34,
172-
"*": 75}},
176+
"*": 75,
177+
}},
173178
"access-control-allow-origin": {35, map[string]uint8{"*": 35}},
174179
"cache-control": {36, map[string]uint8{
175180
"max-age=0": 36,
176181
"max-age=2592000": 37,
177182
"max-age=604800": 38,
178183
"no-cache": 39,
179184
"no-store": 40,
180-
"public, max-age=31536000": 41}},
185+
"public, max-age=31536000": 41,
186+
}},
181187
"content-encoding": {42, map[string]uint8{
182188
"br": 42,
183-
"gzip": 43}},
189+
"gzip": 43,
190+
}},
184191
"content-type": {44, map[string]uint8{
185192
"application/dns-message": 44,
186193
"application/javascript": 45,
@@ -192,39 +199,43 @@ var encoderMap = map[string]indexAndValues{
192199
"text/css": 51,
193200
"text/html; charset=utf-8": 52,
194201
"text/plain": 53,
195-
"text/plain;charset=utf-8": 54}},
202+
"text/plain;charset=utf-8": 54,
203+
}},
196204
"range": {55, map[string]uint8{"bytes=0-": 55}},
197205
"strict-transport-security": {56, map[string]uint8{
198206
"max-age=31536000": 56,
199207
"max-age=31536000; includesubdomains": 57,
200-
"max-age=31536000; includesubdomains; preload": 58}},
208+
"max-age=31536000; includesubdomains; preload": 58,
209+
}},
201210
"vary": {59, map[string]uint8{
202211
"accept-encoding": 59,
203-
"origin": 60}},
212+
"origin": 60,
213+
}},
204214
"x-content-type-options": {61, map[string]uint8{"nosniff": 61}},
205215
"x-xss-protection": {62, map[string]uint8{"1; mode=block": 62}},
206216
// ":status" is duplicated and takes index 63 to 71
207217
"accept-language": {72, nil},
208218
"access-control-allow-credentials": {73, map[string]uint8{
209219
"FALSE": 73,
210-
"TRUE": 74}},
220+
"TRUE": 74,
221+
}},
211222
// "access-control-allow-headers" is duplicated and takes index 75
212223
"access-control-allow-methods": {76, map[string]uint8{
213224
"get": 76,
214225
"get, post, options": 77,
215-
"options": 78}},
216-
"access-control-expose-headers": {79, map[string]uint8{
217-
"content-length": 79,
226+
"options": 78,
218227
}},
219-
"access-control-request-headers": {80, map[string]uint8{
220-
"content-type": 80}},
228+
"access-control-expose-headers": {79, map[string]uint8{"content-length": 79}},
229+
"access-control-request-headers": {80, map[string]uint8{"content-type": 80}},
221230
"access-control-request-method": {81, map[string]uint8{
222231
"get": 81,
223-
"post": 82}},
232+
"post": 82,
233+
}},
224234
"alt-svc": {83, map[string]uint8{"clear": 83}},
225235
"authorization": {84, nil},
226236
"content-security-policy": {85, map[string]uint8{
227-
"script-src 'none'; object-src 'none'; base-uri 'none'": 85}},
237+
"script-src 'none'; object-src 'none'; base-uri 'none'": 85,
238+
}},
228239
"early-data": {86, map[string]uint8{"1": 86}},
229240
"expect-ct": {87, nil},
230241
"forwarded": {88, nil},
@@ -238,5 +249,6 @@ var encoderMap = map[string]indexAndValues{
238249
"x-forwarded-for": {96, nil},
239250
"x-frame-options": {97, map[string]uint8{
240251
"deny": 97,
241-
"sameorigin": 98}},
252+
"sameorigin": 98,
253+
}},
242254
}

0 commit comments

Comments
 (0)