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

Additiona fields in service struct are reset #17

Open
GoogleCodeExporter opened this issue Apr 20, 2015 · 0 comments
Open

Additiona fields in service struct are reset #17

GoogleCodeExporter opened this issue Apr 20, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Create Service Struct
2. Create custom field in addition to endpoint fields
3. Register service
4. Try to use value of field in end point calls

What is the expected output? What do you see instead?
The field value should be set, the custom field is set to nil

What version of the product are you using? On what operating system?
OSX, go 1.2, 

Please provide any additional information below.

See Code:
type DeviceService struct {
    Registrar sns.Registrar

    //Service level config
    gorest.RestService `root:"/rest/device/" consumes:"application/json" produces:"application/json"`

    registerDevice gorest.EndPoint `method:"POST" path:"/" postdata:"DeviceRegistration"`

}


func (serv DeviceService) RegisterDevice(device DeviceRegistration) {

    //The value of registrar is nil when this method is called even though it was set before
    log.Printf("Registering Device %v", serv.Registrar)


    return
}


Original issue reported on code.google.com by [email protected] on 30 Dec 2013 at 7:36

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

1 participant