修复无法格式化输出bool的问题
This commit is contained in:
@@ -57,10 +57,14 @@ func ExtractJsonFieldKeyValues(msg proto.Message, paths []string, needToSnakeCas
|
||||
|
||||
v := rft.Get(fd)
|
||||
switch v.Interface().(type) {
|
||||
case int32, int64, uint32, uint64, float32, float64, bool:
|
||||
case bool:
|
||||
keyValues = append(keyValues, fmt.Sprintf("%t", v.Interface()))
|
||||
case int32, int64, uint32, uint64, float32, float64:
|
||||
keyValues = append(keyValues, fmt.Sprintf("%d", v.Interface()))
|
||||
case string:
|
||||
keyValues = append(keyValues, fmt.Sprintf("'%s'", v.Interface()))
|
||||
default:
|
||||
keyValues = append(keyValues, fmt.Sprintf("%v", v.Interface()))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user