chore: update linter (#1379)

This commit is contained in:
Ludovic Fernandez 2021-03-27 13:49:40 +01:00 committed by GitHub
parent 83c626d9a1
commit ae7daa7d33
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 28 additions and 22 deletions

View file

@ -15,9 +15,9 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:
GO_VERSION: 1.16 GO_VERSION: 1.16
GOLANGCI_LINT_VERSION: v1.38.0 GOLANGCI_LINT_VERSION: v1.39.0
HUGO_VERSION: 0.54.0 HUGO_VERSION: 0.54.0
SEIHON_VERSION: v0.5.1 SEIHON_VERSION: v0.8.3
CGO_ENABLED: 0 CGO_ENABLED: 0
LEGO_E2E_TESTS: CI LEGO_E2E_TESTS: CI
MEMCACHED_HOSTS: localhost:11211 MEMCACHED_HOSTS: localhost:11211

View file

@ -46,29 +46,28 @@
disable = [ disable = [
"interfacer", # deprecated "interfacer", # deprecated
"maligned", # deprecated "maligned", # deprecated
"scopelint", # deprecated
"cyclop", # duplicate of gocyclo
"lll", "lll",
"gas", "gosec",
"dupl", "dupl", # not relevant
"prealloc", "prealloc", # too many false-positive
"scopelint", "bodyclose", # too many false-positive
"bodyclose",
"wsl",
"stylecheck",
"gomnd", "gomnd",
"testpackage", # not relevant "testpackage", # not relevant
"nestif", # too many false-positive
"goerr113", # not relevant
"noctx",
"nlreturn", # not relevant
"wrapcheck",
"tparallel", # not relevant "tparallel", # not relevant
"paralleltest", # not relevant "paralleltest", # not relevant
"exhaustivestruct", # too many false-positive "nestif", # too many false-positive
"wrapcheck",
"goerr113", # not relevant
"nlreturn", # not relevant
"wsl", # not relevant
"exhaustive", # not relevant
"exhaustivestruct", # not relevant
"makezero", # not relevant "makezero", # not relevant
"forbidigo", # not relevant
"ifshort", # not relevant "ifshort", # not relevant
"cyclop", # duplicate of gocyclo "forbidigo", # not relevant
"wastedassign", # false-positive https://github.com/sanposhiho/wastedassign/issues/21 "noctx",
"forcetypeassert", "forcetypeassert",
] ]
@ -79,6 +78,7 @@
exclude = [ exclude = [
"Error return value of .((os\\.)?std(out|err)\\..*|.*Close|.*Flush|os\\.Remove(All)?|.*printf?|os\\.(Un)?Setenv). is not checked", "Error return value of .((os\\.)?std(out|err)\\..*|.*Close|.*Flush|os\\.Remove(All)?|.*printf?|os\\.(Un)?Setenv). is not checked",
"exported (type|method|function) (.+) should have comment or be unexported", "exported (type|method|function) (.+) should have comment or be unexported",
"ST1000: at least one file in a package should have a package comment"
] ]
[[issues.exclude-rules]] [[issues.exclude-rules]]
path = "(.+)_test.go" path = "(.+)_test.go"

View file

@ -75,7 +75,7 @@ type Record struct {
ParentID int `json:"parentId,omitempty"` ParentID int `json:"parentId,omitempty"`
Parent string `json:"parent,omitempty"` Parent string `json:"parent,omitempty"`
Source string `json:"source,omitempty"` Source string `json:"source,omitempty"`
ModifiedTs int64 `json:"modifiedTs,omitempty"` ModifiedTS int64 `json:"modifiedTs,omitempty"`
Value []RecordValue `json:"value,omitempty"` Value []RecordValue `json:"value,omitempty"`
RoundRobin []RecordValue `json:"roundRobin,omitempty"` RoundRobin []RecordValue `json:"roundRobin,omitempty"`
} }

View file

@ -122,7 +122,7 @@ func TestTxtRecordService_Get(t *testing.T) {
ParentID: 273302, ParentID: 273302,
Parent: "domain", Parent: "domain",
Source: "Domain", Source: "Domain",
ModifiedTs: 1580908547863, ModifiedTS: 1580908547863,
Value: []RecordValue{{ Value: []RecordValue{{
Value: `"test"`, Value: `"test"`,
}}, }},

View file

@ -149,8 +149,14 @@ func (m *DNSServerMock) HandleListRecordsetsSuccessfully() {
body, err := ioutil.ReadAll(r.Body) body, err := ioutil.ReadAll(r.Body)
assert.Nil(m.t, err) assert.Nil(m.t, err)
exceptedString := "{\"name\":\"_acme-challenge.example.com.\",\"description\":\"Added TXT record for ACME dns-01 challenge using lego client\",\"type\":\"TXT\",\"ttl\":300,\"records\":[\"\\\"w6uP8Tcg6K2QR905Rms8iXTlksL6OD1KOWBxTK7wxPI\\\"\"]}" exceptedString := `{
assert.Equal(m.t, string(body), exceptedString) "name": "_acme-challenge.example.com.",
"description": "Added TXT record for ACME dns-01 challenge using lego client",
"type": "TXT",
"ttl": 300,
"records": ["\"w6uP8Tcg6K2QR905Rms8iXTlksL6OD1KOWBxTK7wxPI\""]
}`
assert.JSONEq(m.t, string(body), exceptedString)
fmt.Fprintf(w, `{ fmt.Fprintf(w, `{
"recordsets":[{ "recordsets":[{
"id":"321321" "id":"321321"