package funcmap import "encoding/json" func ParseJSON(s string) (interface{}, error) { var v interface{} if err := json.Unmarshal([]byte(s), &v); err != nil { return nil, err } return v, nil } func MarshalJSON(v interface{}) (string, error) { b, err := json.Marshal(v) if err != nil { return "", err } return string(b), nil }