iedc-go/vendor/github.com/go-pay/gopay/pkg/util/string.go

19 lines
245 B
Go
Raw Permalink Normal View History

2022-05-24 05:49:25 +00:00
package util
import "encoding/json"
func ConvertToString(v interface{}) (str string) {
if v == nil {
return NULL
}
var (
bs []byte
err error
)
if bs, err = json.Marshal(v); err != nil {
return NULL
}
str = string(bs)
return
}