WilliamLeaves commented on a change in pull request #1221:
URL: https://github.com/apache/dubbo-go/pull/1221#discussion_r644728023
##########
File path: metadata/report/etcd/report.go
##########
@@ -52,14 +53,28 @@ type etcdMetadataReport struct {
// GetAppMetadata get metadata info from etcd
func (e *etcdMetadataReport) GetAppMetadata(metadataIdentifier
*identifier.SubscriberMetadataIdentifier) (*common.MetadataInfo, error) {
- // TODO will implement
- panic("implement me")
+ key := e.getNodeKey(metadataIdentifier)
+ _data, err := e.client.Get(key)
+ if err != nil {
+ return nil, err
+ }
+ info := &common.MetadataInfo{}
+ err = json.Unmarshal([]byte(_data), info)
+ if err != nil {
Review comment:
It should be "data". Starting with '_' is just a self-style when naming
[]byte type variables
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]