package state func (x *SyncableStatePB) ToGo() (Synced, error) { pbMap, err := x.Map.ToGo() if err != nil { return Synced{}, err } user := x.User.ToGo() return Synced{ Map: pbMap, User: user, }, nil } func (s Synced) ToPB() *SyncableStatePB { return &SyncableStatePB{ Map: s.Map.ToPB(), User: s.User.ToPB(), } }