chore(Makefile): use linter version from dogfood Dockerfile (#11147)

* chore(Makefile): use golangci-lint version from dogfood Dockerfile

* chore(dogfood/Dockerfile): update golangci-lint to latest version

* chore(coderd): address linter complaints
This commit is contained in:
Cian Johnston
2023-12-12 10:02:32 +00:00
committed by GitHub
parent d07fa9c62f
commit 197cd935cf
9 changed files with 10 additions and 12 deletions
+1 -2
View File
@@ -361,9 +361,8 @@ func either[T Auditable, R any](old, new T, fn func(T) R, auditAction database.A
// If the request action is a login or logout, we always want to audit it even if
// there is no diff. See the comment in audit.InitRequest for more detail.
return fn(old)
} else {
panic("both old and new are nil")
}
panic("both old and new are nil")
}
func parseIP(ipStr string) pqtype.Inet {
+1
View File
@@ -987,6 +987,7 @@ func (f fakeRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
return f.roundTrip(req)
}
//nolint:gosec // these are test credentials
const testRSAPrivateKey = `-----BEGIN RSA PRIVATE KEY-----
MIICXQIBAAKBgQDLets8+7M+iAQAqN/5BVyCIjhTQ4cmXulL+gm3v0oGMWzLupUS
v8KPA+Tp7dgC/DZPfMLaNH1obBBhJ9DhS6RdS3AS3kzeFrdu8zFHLWF53DUBhS92
+1 -2
View File
@@ -4679,9 +4679,8 @@ func (q *FakeQuerier) InsertAuditLog(_ context.Context, arg database.InsertAudit
return -1
} else if a.Time.Equal(b.Time) {
return 0
} else {
return 1
}
return 1
})
return alog, nil
+1 -2
View File
@@ -153,9 +153,8 @@ func convertDAUResponse[T dauRow](rows []T, tzOffset int) codersdk.DAUsResponse
return -1
} else if a.Equal(b) {
return 0
} else {
return 1
}
return 1
})
var resp codersdk.DAUsResponse
+1
View File
@@ -25,6 +25,7 @@ import (
"github.com/coder/coder/v2/testutil"
)
//nolint:gosec // these are just for testing
const (
testClientKey = `-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEAnUryZEfn5kA8wuk9a7ogFuWbk3uPHEhioYuAg9m3/tIdqSqu
+1 -2
View File
@@ -79,9 +79,8 @@ func Ascending[T constraints.Ordered](a, b T) int {
return -1
} else if a == b {
return 0
} else {
return 1
}
return 1
}
func Descending[T constraints.Ordered](a, b T) int {