summaryrefslogtreecommitdiffstats
path: root/modules/base/tool_test.go
diff options
context:
space:
mode:
authorkolaente <konrad@kola-entertainments.de>2019-06-12 21:41:28 +0200
committertechknowlogick <techknowlogick@gitea.io>2019-06-12 15:41:28 -0400
commitf9ec2f89f2265bc1371a6c62359de9816534fa6b (patch)
treef48b138a457e5ac6cf843bbb38400926704370f7 /modules/base/tool_test.go
parent5832f8d90df2d72cb38698c3e9050f2b29717dc7 (diff)
downloadgitea-f9ec2f89f2265bc1371a6c62359de9816534fa6b.tar.gz
gitea-f9ec2f89f2265bc1371a6c62359de9816534fa6b.zip
Add golangci (#6418)
Diffstat (limited to 'modules/base/tool_test.go')
-rw-r--r--modules/base/tool_test.go15
1 files changed, 7 insertions, 8 deletions
diff --git a/modules/base/tool_test.go b/modules/base/tool_test.go
index ec9bc1eb52..fa61e5dfb1 100644
--- a/modules/base/tool_test.go
+++ b/modules/base/tool_test.go
@@ -287,20 +287,19 @@ func TestHtmlTimeSince(t *testing.T) {
}
func TestFileSize(t *testing.T) {
- var size int64
- size = 512
+ var size int64 = 512
assert.Equal(t, "512B", FileSize(size))
- size = size * 1024
+ size *= 1024
assert.Equal(t, "512KB", FileSize(size))
- size = size * 1024
+ size *= 1024
assert.Equal(t, "512MB", FileSize(size))
- size = size * 1024
+ size *= 1024
assert.Equal(t, "512GB", FileSize(size))
- size = size * 1024
+ size *= 1024
assert.Equal(t, "512TB", FileSize(size))
- size = size * 1024
+ size *= 1024
assert.Equal(t, "512PB", FileSize(size))
- size = size * 4
+ size *= 4
assert.Equal(t, "2.0EB", FileSize(size))
}