mirror of
https://github.com/fiatjaf/khatru.git
synced 2025-03-28 18:51:52 +01:00
properly scan tags from database
This commit is contained in:
parent
3dacb07b62
commit
6c6bf45c72
4
event.go
4
event.go
@ -32,7 +32,7 @@ type Event struct {
|
|||||||
|
|
||||||
type Tags []Tag
|
type Tags []Tag
|
||||||
|
|
||||||
func (t Tags) Scan(src interface{}) error {
|
func (t *Tags) Scan(src interface{}) error {
|
||||||
var jtags []byte = make([]byte, 0)
|
var jtags []byte = make([]byte, 0)
|
||||||
|
|
||||||
switch v := src.(type) {
|
switch v := src.(type) {
|
||||||
@ -44,7 +44,7 @@ func (t Tags) Scan(src interface{}) error {
|
|||||||
return errors.New("couldn't scan tags, it's not a json string")
|
return errors.New("couldn't scan tags, it's not a json string")
|
||||||
}
|
}
|
||||||
|
|
||||||
json.Unmarshal(jtags, t)
|
json.Unmarshal(jtags, &t)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user