From aa93b39d9b195b11ddd76c1c7d325bec99843f0d Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Fri, 24 Jul 2020 16:16:45 +0100 Subject: [PATCH] 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 --- fs/asyncreader/asyncreader_test.go | 4 ++-- fs/walk/walk_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/asyncreader/asyncreader_test.go b/fs/asyncreader/asyncreader_test.go index 2a5e06099..4aab06604 100644 --- a/fs/asyncreader/asyncreader_test.go +++ b/fs/asyncreader/asyncreader_test.go @@ -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 diff --git a/fs/walk/walk_test.go b/fs/walk/walk_test.go index 373ffe753..e50e9478a 100644 --- a/fs/walk/walk_test.go +++ b/fs/walk/walk_test.go @@ -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