// 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 }
func (m *JsonHelperScannable) MarshalJSON() ([]byte, error) { return json.Marshal(u.JsonHelper(*m)) }