mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
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:
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user