From 234708062a86ae0cb00002c2947443ffe800c550 Mon Sep 17 00:00:00 2001 From: xlwcom Date: Thu, 29 Jun 2017 13:32:40 +0800 Subject: [PATCH] fix the bug in the "ParseBool" function in the file of config.go --- config/config.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/config.go b/config/config.go index e8201a24..a9ef7a9a 100644 --- a/config/config.go +++ b/config/config.go @@ -189,16 +189,16 @@ func ParseBool(val interface{}) (value bool, err error) { return false, nil } case int8, int32, int64: - strV := fmt.Sprintf("%s", v) + strV := fmt.Sprintf("%d", v) // w 由 %s 修改为 %d if strV == "1" { return true, nil } else if strV == "0" { return false, nil } case float64: - if v == 1 { + if v == 1.0 { // w 由 1 修改为 1.0 return true, nil - } else if v == 0 { + } else if v == 0.0 { // w 由 0 修改为 0.0 return false, nil } }