database issues

This commit is contained in:
Karmanyaah Malhotra committed 2021-02-28 15:02:11 -05:00
1 parent b8044adf3f
commit daf1edffb7
4 files changed
+11 -13

No files matched your search

+3 -3
View File
@@ -12,13 +12,13 @@ import (
type Message struct{ groupme.Message }
func (m *Message) Scan(value interface{}) error {
bytes, ok := value.([]byte)
bytes, ok := value.(string)
if !ok {
return errors.New(fmt.Sprint("Failed to unmarshal JSONB value:", value))
return errors.New(fmt.Sprint("Failed to unmarshal json value:", value))
}
message := Message{}
err := json.Unmarshal(bytes, &message)
err := json.Unmarshal([]byte(bytes), &message)
*m = Message(message)
return err