Hi im trying to unmarshal datastore entity that contain ByteString field.
But i'm getting unmarshal error, i can't figure out a way to unmarshal it Should i create my own PropertyLoadSaver ??
json: cannot unmarshal string into Go value of type
datastore.ByteString
package main
import (
"encoding/json"
"fmt"
"google.golang.org/appengine/datastore"
)
type User struct {
SubscriptionToken datastore.ByteString
}
func main() {
u := new(User)
str := "{\"SubscriptionToken\":\"YWR66969hjgkgkgo\"}"
err := json.Unmarshal([]byte(str), &u)
if err != nil {
fmt.Println(err)
}
fmt.Println(u)
}