database issues

This commit is contained in:
Karmanyaah Malhotra
2021-02-28 15:02:11 -05:00
parent b8044adf3f
commit daf1edffb7
4 changed files with 11 additions and 13 deletions

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