Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run gofumpt, add a few more linters #21

Merged
merged 3 commits into from
Oct 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:
uses: golangci/golangci-lint-action@v1
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.30
version: v1.32
6 changes: 5 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@ linters-settings:
linters:
disable-all: true
enable:
- asciicheck
- deadcode
- exhaustive
- exportloopref
- goconst
- gofmt
- gofmt # redundant, since gofmt *should* be a no-op after gofumpt
- gofumpt
- goimports
- gosimple
- ineffassign
Expand Down
1 change: 0 additions & 1 deletion encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ func (e *Encoder) WriteField(f HeaderField) error {
e.writeLiteralFieldWithNameReference(&f, idxAndVals.idx)
}
}

} else {
e.writeLiteralFieldWithoutNameReference(f)
}
Expand Down
1 change: 0 additions & 1 deletion integrationtests/interop/interop_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ func currentDir() string {
}

var _ = Describe("Interop", func() {

// find all encoded files with a dynamic table size of 0
findFiles := func() []string {
var files []string
Expand Down
50 changes: 31 additions & 19 deletions static_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,12 @@ var encoderMap = map[string]indexAndValues{
"HEAD": 18,
"OPTIONS": 19,
"POST": 20,
"PUT": 21}},
"PUT": 21,
}},
":scheme": {22, map[string]uint8{
"http": 22,
"https": 23}},
"https": 23,
}},
":status": {24, map[string]uint8{
"103": 24,
"200": 25,
Expand All @@ -160,27 +162,32 @@ var encoderMap = map[string]indexAndValues{
"403": 68,
"421": 69,
"425": 70,
"500": 71}},
"500": 71,
}},
"accept": {29, map[string]uint8{
"*/*": 29,
"application/dns-message": 30}},
"application/dns-message": 30,
}},
"accept-encoding": {31, map[string]uint8{"gzip, deflate, br": 31}},
"accept-ranges": {32, map[string]uint8{"bytes": 32}},
"access-control-allow-headers": {33, map[string]uint8{
"cache-control": 33,
"content-type": 34,
"*": 75}},
"*": 75,
}},
"access-control-allow-origin": {35, map[string]uint8{"*": 35}},
"cache-control": {36, map[string]uint8{
"max-age=0": 36,
"max-age=2592000": 37,
"max-age=604800": 38,
"no-cache": 39,
"no-store": 40,
"public, max-age=31536000": 41}},
"public, max-age=31536000": 41,
}},
"content-encoding": {42, map[string]uint8{
"br": 42,
"gzip": 43}},
"gzip": 43,
}},
"content-type": {44, map[string]uint8{
"application/dns-message": 44,
"application/javascript": 45,
Expand All @@ -192,39 +199,43 @@ var encoderMap = map[string]indexAndValues{
"text/css": 51,
"text/html; charset=utf-8": 52,
"text/plain": 53,
"text/plain;charset=utf-8": 54}},
"text/plain;charset=utf-8": 54,
}},
"range": {55, map[string]uint8{"bytes=0-": 55}},
"strict-transport-security": {56, map[string]uint8{
"max-age=31536000": 56,
"max-age=31536000; includesubdomains": 57,
"max-age=31536000; includesubdomains; preload": 58}},
"max-age=31536000; includesubdomains; preload": 58,
}},
"vary": {59, map[string]uint8{
"accept-encoding": 59,
"origin": 60}},
"origin": 60,
}},
"x-content-type-options": {61, map[string]uint8{"nosniff": 61}},
"x-xss-protection": {62, map[string]uint8{"1; mode=block": 62}},
// ":status" is duplicated and takes index 63 to 71
"accept-language": {72, nil},
"access-control-allow-credentials": {73, map[string]uint8{
"FALSE": 73,
"TRUE": 74}},
"TRUE": 74,
}},
// "access-control-allow-headers" is duplicated and takes index 75
"access-control-allow-methods": {76, map[string]uint8{
"get": 76,
"get, post, options": 77,
"options": 78}},
"access-control-expose-headers": {79, map[string]uint8{
"content-length": 79,
"options": 78,
}},
"access-control-request-headers": {80, map[string]uint8{
"content-type": 80}},
"access-control-expose-headers": {79, map[string]uint8{"content-length": 79}},
"access-control-request-headers": {80, map[string]uint8{"content-type": 80}},
"access-control-request-method": {81, map[string]uint8{
"get": 81,
"post": 82}},
"post": 82,
}},
"alt-svc": {83, map[string]uint8{"clear": 83}},
"authorization": {84, nil},
"content-security-policy": {85, map[string]uint8{
"script-src 'none'; object-src 'none'; base-uri 'none'": 85}},
"script-src 'none'; object-src 'none'; base-uri 'none'": 85,
}},
"early-data": {86, map[string]uint8{"1": 86}},
"expect-ct": {87, nil},
"forwarded": {88, nil},
Expand All @@ -238,5 +249,6 @@ var encoderMap = map[string]indexAndValues{
"x-forwarded-for": {96, nil},
"x-frame-options": {97, map[string]uint8{
"deny": 97,
"sameorigin": 98}},
"sameorigin": 98,
}},
}