From 81267b9903e0fd4bba2369f28c223a75864f2236 Mon Sep 17 00:00:00 2001 From: Adrian Date: Sun, 1 Oct 2017 01:40:19 +0800 Subject: [PATCH] add comments to satisfy gofmt --- dialects/postgres/postgres.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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)) }