Example #1
0
// This is the go sql/driver interface we need to implement to allow
// conversion back forth
func (m JsonHelperScannable) Value() (driver.Value, error) {
	jsonBytes, err := json.Marshal(u.JsonHelper(m))
	if err != nil {
		return []byte{}, err
	}
	return jsonBytes, nil
}
Example #2
0
func (m *JsonHelperScannable) MarshalJSON() ([]byte, error) {
	return json.Marshal(u.JsonHelper(*m))
}