fix (#533): json conversion issue

This commit is contained in:
Mickael Kerjean 2023-03-31 08:20:51 +11:00
parent aefe20bd26
commit 86dde05507

View file

@ -3,6 +3,7 @@ package common
import (
"bytes"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"strconv"
@ -58,8 +59,9 @@ func NewStringpFromInterface(val interface{}) *string {
func NewStringFromInterface(val interface{}) string {
switch val.(type) {
case string:
v := val.(string)
return v
return val.(string)
case float64:
return fmt.Sprintf("%d", int64(val.(float64)))
default:
return ""
}