10 lines
188 B
Go
Raw Normal View History

2017-07-07 00:07:34 +00:00
package utils
import "encoding/json"
// ToJSON converts an object to a JSON string, ignoring errors.
func ToJSON(v interface{}) string {
str, _ := json.Marshal(v)
return string(str)
}