You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2021/06/03 14:59:06 UTC

[GitHub] [dubbo-go] AlexStocks commented on a change in pull request #1221: application service discovery support etcd reporter

AlexStocks commented on a change in pull request #1221:
URL: https://github.com/apache/dubbo-go/pull/1221#discussion_r644868683



##########
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)

Review comment:
       pls delete the following 4 line codes. `return info, err` is just enough.




-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org