Skip to content

Decoding to embedded struct doesn't work #58

@Isolus

Description

@Isolus

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"`
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions