mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-06 08:22:24 +01:00
fix (#533): json conversion issue
This commit is contained in:
parent
aefe20bd26
commit
86dde05507
1 changed files with 4 additions and 2 deletions
|
|
@ -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 ""
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue