diff options
author | Bo-Yi Wu <appleboy.tw@gmail.com> | 2019-05-28 23:45:54 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-28 23:45:54 +0800 |
commit | 743697a549bda16508ab961ac79a8bc5bdca3bbd (patch) | |
tree | 23d40a210acd7b84dd62f6c5ec73dfea938faa5f /modules/base/tool_test.go | |
parent | 31557b12744410633ceb6fc12b53fb09038cee35 (diff) | |
download | gitea-743697a549bda16508ab961ac79a8bc5bdca3bbd.tar.gz gitea-743697a549bda16508ab961ac79a8bc5bdca3bbd.zip |
refactor: append, build variable and type switch (#4940)
* refactor: append, build variable and type switch
* fix: remove redundant space.
Diffstat (limited to 'modules/base/tool_test.go')
-rw-r--r-- | modules/base/tool_test.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/modules/base/tool_test.go b/modules/base/tool_test.go index dcaf2fcbb0..ec9bc1eb52 100644 --- a/modules/base/tool_test.go +++ b/modules/base/tool_test.go @@ -306,21 +306,21 @@ func TestFileSize(t *testing.T) { func TestSubtract(t *testing.T) { toFloat64 := func(n interface{}) float64 { - switch n := n.(type) { + switch v := n.(type) { case int: - return float64(n) + return float64(v) case int8: - return float64(n) + return float64(v) case int16: - return float64(n) + return float64(v) case int32: - return float64(n) + return float64(v) case int64: - return float64(n) + return float64(v) case float32: - return float64(n) + return float64(v) case float64: - return n + return v default: return 0.0 } |