Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to decode field config - extra data in buffer #72

Closed
ramesh-lingappan opened this issue Jul 12, 2017 · 3 comments
Closed

Failed to decode field config - extra data in buffer #72

ramesh-lingappan opened this issue Jul 12, 2017 · 3 comments

Comments

@ramesh-lingappan
Copy link

Hi,
Am trying to store a struct into datastore like below,

type Config struct {
Id int64 datastore:"id,noindex" goon:"id" json:"id"
Config map[string]float64 datastore:"config,noindex" json:"config,omitempty"
}

I have also impl PropertyLoaderSaver interface to convert the map into json string before saving to datastore, everything work fine with datastore, while fetching the json string is convert to back to map,

But when this entity is fetched from memcache am getting following error from goon.go file,

goon - goon.go:475 - goon: Failed to decode field config - extra data in buffer

Any help on how to fix this issue?

Note: Every First time fetch from datastore it works fine, only subsequent fetch (while it fetch from memcache) its throwing this error

@xStrom
Copy link
Collaborator

xStrom commented Jul 12, 2017

Unfortunately PropertyLoadSaver isn't fully supported yet. You may be in luck soon though, as there is a PR for supporting it (#69). My current plan is to review that PR this weekend.

(I'm not 100% sure if that PR will make your code work, I hope it will, but I'm 100% sure that the current goon version doesn't support PropertyLoadSaver)


PS. Completely unrelated to your issue, but you don't need to store the Id property in the datastore like that, it's already part of the key.

Id int64 `datastore:"-" goon:"id" json:"id"`

@ramesh-lingappan
Copy link
Author

Thanks, i did looked the PR, sounds promising , awaiting for it. And thanks for pointing out the issue, will ignore storing id.

@xStrom
Copy link
Collaborator

xStrom commented Apr 22, 2019

PropertyLoadSaver is now supported, so this issue is resolved.

@xStrom xStrom closed this as completed Apr 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants