Skip to content

Commit 66842fa

Browse files
committed
fix: lint
1 parent 8635651 commit 66842fa

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

errors/fmt.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ func (e *wrapError) GoString() string {
235235
typ := reflect.TypeOf(*e)
236236
val := reflect.ValueOf(*e)
237237
elems := make([]string, typ.NumField())
238-
for i := 0; typ.NumField() > i; i++ {
238+
for i := range typ.NumField() {
239239
elems[i] = fmt.Sprintf("%s:%#v", typ.Field(i).Name, val.Field(i))
240240
}
241241
return fmt.Sprintf("&%s{%s}", typ, strings.Join(elems, ", "))

exp/database/sql/query.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func Columns(tableStruct interface{}, structTag string) []string {
3535
}
3636

3737
var columns []string
38-
for i := 0; i < structType.NumField(); i++ {
38+
for i := range structType.NumField() {
3939
structField := structType.Field(i)
4040
if structField.Anonymous {
4141
continue

integrationtest/internal/database/sql/common.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func (u *TestUser) GoString() string {
1717
typ := reflect.TypeOf(*u)
1818
val := reflect.ValueOf(*u)
1919
elems := make([]string, typ.NumField())
20-
for i := 0; typ.NumField() > i; i++ {
20+
for i := range typ.NumField() {
2121
elems[i] = fmt.Sprintf("%s:%#v", typ.Field(i).Name, val.Field(i))
2222
}
2323
return fmt.Sprintf("&%s{%s}", typ, strings.Join(elems, ", "))

jose/jwk/jwk.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -406,11 +406,11 @@ func (jwk *JSONWebKey) DecodeRSAPublicKey() (*rsa.PublicKey, error) {
406406
if err != nil {
407407
return nil, fmt.Errorf("base64.RawURLEncoding.DecodeString: JSONWebKey.E=%s: %w", jwk.E, err)
408408
}
409-
eBigInt := big.NewInt(0).SetBytes(eByte)
410-
if eBigInt.Uint64() > math.MaxInt {
411-
return nil, fmt.Errorf("e=%d: %w", eBigInt.Uint64(), ErrInvalidKey)
409+
eUint := big.NewInt(0).SetBytes(eByte).Uint64()
410+
if eUint > math.MaxInt {
411+
return nil, fmt.Errorf("e=%d: %w", eUint, ErrInvalidKey)
412412
}
413-
e := int(eBigInt.Uint64())
413+
e := int(eUint)
414414

415415
return &rsa.PublicKey{
416416
N: n,

log/ilog/ilog_default_implementation.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ const null = "null"
675675
// nolint: cyclop
676676
// appendJSONEscapedString.
677677
func appendJSONEscapedString(dst []byte, s string) []byte {
678-
for i := 0; i < len(s); i++ {
678+
for i := range len(s) {
679679
if s[i] != '"' && s[i] != '\\' && s[i] > 0x1F {
680680
dst = append(dst, s[i])
681681

0 commit comments

Comments
 (0)