build: fix tests on go1.15

go1.15 introduced a stricter policy for what you can convert with
`string()` and now `go vet` warns if you try to do `string(int)`.

See: https://github.com/golang/go/issues/32479
This commit is contained in:
Nick Craig-Wood 2020-07-24 16:16:45 +01:00
parent 101f82c6b3
commit aa93b39d9b
2 changed files with 3 additions and 3 deletions

View File

@ -146,7 +146,7 @@ func TestAsyncReaderSizes(t *testing.T) {
for i := 0; i < len(texts)-1; i++ {
texts[i] = str + "\n"
all += texts[i]
str += string(i%26 + 'a')
str += string(rune(i)%26 + 'a')
}
texts[len(texts)-1] = all
@ -185,7 +185,7 @@ func TestAsyncReaderWriteTo(t *testing.T) {
for i := 0; i < len(texts)-1; i++ {
texts[i] = str + "\n"
all += texts[i]
str += string(i%26 + 'a')
str += string(rune(i)%26 + 'a')
}
texts[len(texts)-1] = all

View File

@ -358,7 +358,7 @@ func walkErrors(t *testing.T, expectedErr error) *listDirs {
em := errorMap{}
de := make(fs.DirEntries, 10)
for i := range de {
path := string('0' + i)
path := string('0' + rune(i))
de[i] = mockdir.New(path)
lr[path] = listResult{entries: nil, err: fs.ErrorDirNotFound}
em[path] = fs.ErrorDirNotFound