Go GORM查詢PostgreSQL的jsonb欄位並轉換為struct結構時發生錯誤。
以「Golang GORM jsonb欄位struct轉換」為例,查詢時出現Scan error on column index 3, name "contact": unsupported Scan, storing driver.Value type []uint8 into type *main.Contact: system internal error。
搞了半天原來是忘了實作Contact的Scanner.Scan導致解析jsonb為Contact時出現錯誤。
沒有留言:
張貼留言