-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Closed

Description
type Article struct {
Id int64 `json:"id"`
Title string `json:"title"`
}
func (m *Article) UnmarshalBinary(data []byte) error {
return json.Unmarshal(data, m)
}
func (m *Article) MarshalBinary() (data []byte, err error) {
return json.Marshal(m)
}
var context.Background()
var value = []&Article{
{Title: "1",Id:1},
{Title: "2",Id:2}
}
var expired = time.Hour * 24 * 7
reids.Set(ctx,key,value,expired)
err:
can't marshal []*Article (implement encoding.BinaryMarshaler)
do I need to serialize manually?
Metadata
Metadata
Assignees
Labels
No labels