Skip to content

Commit

Permalink
Merge pull request cockroachdb#57791 from andreimatei/backport20.2-55547
Browse files Browse the repository at this point in the history
release-20.2: *: go 1.15 linter fixes
  • Loading branch information
andreimatei authored Dec 10, 2020
2 parents 900e6e2 + 5e43229 commit 5483127
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
8 changes: 4 additions & 4 deletions pkg/ccl/changefeedccl/name_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ func TestSQLNameToKafkaName(t *testing.T) {
{`/`, `_u002f_`},
{`☃`, `_u2603_`},
{"\x00", `_u0000_`},
{string(utf8.RuneSelf), `_u0080_`},
{string(utf8.MaxRune), `_u0010ffff_`},
{string(rune(utf8.RuneSelf)), `_u0080_`},
{string(rune(utf8.MaxRune)), `_u0010ffff_`},
// special case: exact match of . and .. are disallowed by kafka
{`.`, `_u002e_`},
{`..`, `_u002e__u002e_`},
Expand Down Expand Up @@ -77,8 +77,8 @@ func TestSQLNameToAvroName(t *testing.T) {
{`/`, `_u002f_`},
{`☃`, `_u2603_`},
{"\x00", `_u0000_`},
{string(utf8.RuneSelf), `_u0080_`},
{string(utf8.MaxRune), `_u0010ffff_`},
{string(rune(utf8.RuneSelf)), `_u0080_`},
{string(rune(utf8.MaxRune)), `_u0010ffff_`},
}
for i, test := range tests {
if a := SQLNameToAvroName(test.sql); a != test.avro {
Expand Down
4 changes: 2 additions & 2 deletions pkg/kv/kvclient/kvcoord/dist_sender_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2932,11 +2932,11 @@ func TestCountRanges(t *testing.T) {
for i := range descriptors {
startKey := testMetaEndKey
if i > 0 {
startKey = roachpb.RKey(string(firstKeyBoundary + i - 1))
startKey = roachpb.RKey(string(rune(firstKeyBoundary + i - 1)))
}
endKey := roachpb.RKeyMax
if i < len(descriptors)-1 {
endKey = roachpb.RKey(string(firstKeyBoundary + i))
endKey = roachpb.RKey(string(rune(firstKeyBoundary + i)))
}

descriptors[i] = roachpb.RangeDescriptor{
Expand Down
4 changes: 2 additions & 2 deletions pkg/kv/kvserver/concurrency/lock_table_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@ func TestLockTableConcurrentSingleRequests(t *testing.T) {
}
var keys []roachpb.Key
for i := 0; i < 10; i++ {
keys = append(keys, roachpb.Key(string('a'+i)))
keys = append(keys, roachpb.Key(string(rune('a'+i))))
}
rng := rand.New(rand.NewSource(uint64(timeutil.Now().UnixNano())))

Expand Down Expand Up @@ -960,7 +960,7 @@ func TestLockTableConcurrentRequests(t *testing.T) {
}
var keys []roachpb.Key
for i := 0; i < 10; i++ {
keys = append(keys, roachpb.Key(string('a'+i)))
keys = append(keys, roachpb.Key(string(rune('a'+i))))
}
rng := rand.New(rand.NewSource(uint64(timeutil.Now().UnixNano())))
const numActiveTxns = 8
Expand Down
5 changes: 3 additions & 2 deletions pkg/kv/kvserver/replica_raftstorage.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"context"
"fmt"
"math"
"strconv"
"sync/atomic"
"time"

Expand Down Expand Up @@ -1173,8 +1174,8 @@ func extractRangeFromEntries(logEntries [][]byte) (string, error) {
return "", err
}

firstIndex = string(firstAndLastLogEntries[0].Index)
lastIndex = string(firstAndLastLogEntries[1].Index)
firstIndex = strconv.FormatUint(firstAndLastLogEntries[0].Index, 10)
lastIndex = strconv.FormatUint(firstAndLastLogEntries[1].Index, 10)
}
return fmt.Sprintf("[%s, %s]", firstIndex, lastIndex), nil
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/util/encoding/encoding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1502,7 +1502,7 @@ func BenchmarkPeekType(b *testing.B) {
for i := 0; i < b.N; i++ {
typ = PeekType(buf)
}
sink = string(typ)
sink = fmt.Sprint(typ)
}

type randData struct {
Expand Down

0 comments on commit 5483127

Please sign in to comment.