// MarshalToJSON marshals a struct to json
// it works like `Marshal` but returns json instead
MarshalToJSON marshals a struct to json
it works like `Marshal` but returns json instead
// MarshalToJSON marshals a struct to json // it works like ` Marshal ` but returns json instead
func MarshalToJSON(val interface{}) ([]byte, error) {
	result, err := Marshal(val)
	if err != nil {
		return []byte{}, err
	}
	return json.Marshal(result)
}
func MarshalToJSON ( val interface { } ) ( [ ] byte , error ) { result , err := Marshal ( val ) if err != nil { return [ ] byte { } , err } return json . Marshal ( result ) }
MarshalToJSON marshals a struct to json
it works like `Marshal` but returns json instead
MarshalToJSON marshals a struct to json it works like ` Marshal ` but returns json instead