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

Decoding to embedded struct doesn't work #58

Open
Isolus opened this issue Feb 3, 2019 · 0 comments
Open

Decoding to embedded struct doesn't work #58

Isolus opened this issue Feb 3, 2019 · 0 comments

Comments

@Isolus
Copy link

Isolus commented Feb 3, 2019

I have a lot of responses where some fields are always the same.
So I tried to use an embedded struct like this:

type Status struct {
	Code          int    `xmlrpc:"code"`
	Msg           string `xmlrpc:"msg"`
}
type Type1Response struct {
	Status
	CustomerId int    `xmlrpc:"customerId"`
}

But Code and Msg are never set.
The following works, but since the Status struct I'm really using is much bigger I have to repeat a lot of code.

type Type1Response struct {
	Code          int    `xmlrpc:"code"`
	Msg           string `xmlrpc:"msg"`
	CustomerId    int    `xmlrpc:"customerId"`
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants