From e6fe9c8e08bcae470069179338148143160db9dc Mon Sep 17 00:00:00 2001 From: ShuheiKubota Date: Mon, 18 Nov 2019 18:45:06 +0900 Subject: [PATCH] refactor: if-return-else-return to if-return and return --- vvin.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/vvin.go b/vvin.go index dda6b53..d439f3a 100644 --- a/vvin.go +++ b/vvin.go @@ -219,13 +219,13 @@ func toInt(s string, max int) int32 { i = 100 } return int32(math.Trunc(float64(max*i) / 100)) - } else { - i, err := strconv.Atoi(s) - if err != nil { - return 0 - } - return int32(i) } + + i, err := strconv.Atoi(s) + if err != nil { + return 0 + } + return int32(i) } func findFirstTarget(title string, wins []*window, ancestors []int) *window {