func (c *UserContext) MarshalJSON() ([]byte, error) {
	roles := c.Roles
	if roles == nil {
		roles = []string{}
	}
	output := map[string]interface{}{
		"roles": roles,
	}
	if c.Database != "" {
		output["db"] = c.Database
	}
	if c.Name != "" {
		output["name"] = c.Name
	} else {
		output["name"] = nil
	}
	return json.Marshal(output)
}
// MarshalJSON satisfies the json.Marshaler interface.
MarshalJSON satisfies the json.Marshaler interface.
// MarshalJSON satisfies the json . Marshaler interface .
func (c *UserContext) MarshalJSON() ([]byte, error) {
	roles := c.Roles
	if roles == nil {
		roles = []string{}
	}
	output := map[string]interface{}{
		"roles": roles,
	}
	if c.Database != "" {
		output["db"] = c.Database
	}
	if c.Name != "" {
		output["name"] = c.Name
	} else {
		output["name"] = nil
	}
	return json.Marshal(output)
}
func ( c * UserContext ) MarshalJSON ( ) ( [ ] byte , error ) { roles := c . Roles if roles == nil { roles = [ ] string { } } output := map [ string ] interface { } { " " : roles , } if c . Database != " " { output [ " " ] = c . Database } if c . Name != " " { output [ " " ] = c . Name } else { output [ " " ] = nil } return json . Marshal ( output ) }
MarshalJSON satisfies the json.Marshaler interface.
MarshalJSON satisfies the json . Marshaler interface .