more data
This commit is contained in:
@@ -13,6 +13,20 @@ import (
|
||||
|
||||
type CartId [16]byte
|
||||
|
||||
func (id CartId) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(id.String())
|
||||
}
|
||||
|
||||
func (id *CartId) UnmarshalJSON(data []byte) error {
|
||||
var str string
|
||||
err := json.Unmarshal(data, &str)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
copy(id[:], []byte(str))
|
||||
return nil
|
||||
}
|
||||
|
||||
type CartItem struct {
|
||||
Sku string `json:"sku"`
|
||||
Name string `json:"name"`
|
||||
|
||||
Reference in New Issue
Block a user