VolkerCH / gorest

Automatically exported from code.google.com/p/gorest
0 stars 0 forks source link

Additiona fields in service struct are reset #17

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
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 0xffff...@gmail.com on 30 Dec 2013 at 7:36