Skip to content
Snippets Groups Projects
Unverified Commit 129f6bdc authored by James Yao's avatar James Yao Committed by GitHub
Browse files

Update readwriter.go

update Service.Interface to have default value Service.Path
parent 9a7951e9
No related branches found
No related tags found
No related merge requests found
......@@ -140,10 +140,14 @@ func (p *RpcServerPackageHandler) Read(ss getty.Session, data []byte) (interface
if req[6] != nil {
attachments = req[6].(map[interface{}]interface{})
}
pkg.Service.Interface = attachments[constant.INTERFACE_KEY].(string)
if pkg.Service.Path == "" && attachments[constant.PATH_KEY] != nil {
pkg.Service.Path = attachments[constant.PATH_KEY].(string)
}
if _, ok := attachments[constant.INTERFACE_KEY]; ok {
pkg.Service.Interface = attachments[constant.INTERFACE_KEY].(string)
} else {
pkg.Service.Interface = pkg.Service.Path
}
if attachments[constant.GROUP_KEY] != nil {
pkg.Service.Group = attachments[constant.GROUP_KEY].(string)
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment