Skip to content

Commit 31e99fb

Browse files
committed
unmarshal the data receive from postgres
1 parent 0381cef commit 31e99fb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

model/task.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package model
22

3+
import "encoding/json"
4+
35
type TaskMeta struct {
46
TaskId string `json:"taskId"`
57
TaskType string `json:"taskType"`
@@ -48,3 +50,7 @@ type JoinData struct {
4850
ServerId string `json:"serverId"`
4951
Status int `json:"status"`
5052
}
53+
54+
func (m *TaskMeta) Scan(value interface{}) error {
55+
return json.Unmarshal(value.([]byte), m)
56+
}

0 commit comments

Comments
 (0)