diff --git a/dialects/postgres/postgres.go b/dialects/postgres/postgres.go index fe71065b..b8e76891 100644 --- a/dialects/postgres/postgres.go +++ b/dialects/postgres/postgres.go @@ -56,17 +56,19 @@ func (h *Hstore) Scan(value interface{}) error { return nil } -// for Postgresql's JSONB data type +// Jsonb Postgresql's JSONB data type type Jsonb struct { json.RawMessage } -func (j Jsonb) Value() (driver.Value, error){ +// Value get value of Jsonb +func (j Jsonb) Value() (driver.Value, error) { return j.MarshalJSON() } -func (j *Jsonb) Scan (value interface{}) error { - bytes, ok := value.([]byte); +// Scan scan value into Jsonb +func (j *Jsonb) Scan(value interface{}) error { + bytes, ok := value.([]byte) if !ok { return errors.New(fmt.Sprint("Failed to unmarshal JSONB value:", value)) }