From aebe31225c4c90a8705f8181ae91f3e73656c61a Mon Sep 17 00:00:00 2001
From: watermelo <80680489@qq.com>
Date: Mon, 8 Jun 2020 12:44:08 +0800
Subject: [PATCH]     Mod: modify inappropriate comments after review

---
 metadata/identifier/base_metadata_identifier.go      | 7 +++++--
 metadata/identifier/metadata_identifier.go           | 6 +++---
 metadata/identifier/service_metadata_identifier.go   | 9 +++++----
 metadata/identifier/subscribe_metadata_identifier.go | 5 +++--
 4 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/metadata/identifier/base_metadata_identifier.go b/metadata/identifier/base_metadata_identifier.go
index 963c3d1a5..3eca5e1bb 100644
--- a/metadata/identifier/base_metadata_identifier.go
+++ b/metadata/identifier/base_metadata_identifier.go
@@ -25,11 +25,13 @@ import (
 	"github.com/apache/dubbo-go/common/constant"
 )
 
+// BaseMetadataIdentifier defined for describe the Metadata base identify
 type BaseMetadataIdentifier interface {
 	getFilePathKey(params ...string) string
 	getIdentifierKey(params ...string) string
 }
 
+// BaseMetadataIdentifier is the base implement of BaseMetadataIdentifier interface
 type BaseServiceMetadataIdentifier struct {
 	serviceInterface string
 	version          string
@@ -37,6 +39,7 @@ type BaseServiceMetadataIdentifier struct {
 	side             string
 }
 
+// joinParams will join the specified char in slice, and build as string
 func joinParams(joinChar string, params []string) string {
 	var joinedStr string
 	for _, param := range params {
@@ -46,7 +49,7 @@ func joinParams(joinChar string, params []string) string {
 	return joinedStr
 }
 
-// getIdentifierKey gets metadata identifier key by @params
+// getIdentifierKey will return string format as service:Version:Group:Side:param1:param2...
 func (mdi *BaseServiceMetadataIdentifier) getIdentifierKey(params ...string) string {
 	return mdi.serviceInterface +
 		constant.KEY_SEPARATOR + mdi.version +
@@ -55,7 +58,7 @@ func (mdi *BaseServiceMetadataIdentifier) getIdentifierKey(params ...string) str
 		joinParams(constant.KEY_SEPARATOR, params)
 }
 
-// getFilePathKey gets metadata file path key by @params
+// getFilePathKey will return string format as metadata/path/Version/Group/Side/param1/param2...
 func (mdi *BaseServiceMetadataIdentifier) getFilePathKey(params ...string) string {
 	path := serviceToPath(mdi.serviceInterface)
 
diff --git a/metadata/identifier/metadata_identifier.go b/metadata/identifier/metadata_identifier.go
index e97795b4c..03b150c6b 100644
--- a/metadata/identifier/metadata_identifier.go
+++ b/metadata/identifier/metadata_identifier.go
@@ -17,18 +17,18 @@
 
 package identifier
 
-// The MetadataIdentifier is used to store method descriptor
+// MetadataIdentifier is inherit baseMetaIdentifier with Application name
 type MetadataIdentifier struct {
 	application string
 	BaseMetadataIdentifier
 }
 
-// getIdentifierKey gets metadata identifier key by @mdi.application
+// GetIdentifierKey will return string format as service:Version:Group:Side:Application
 func (mdi *MetadataIdentifier) getIdentifierKey(params ...string) string {
 	return mdi.BaseMetadataIdentifier.getIdentifierKey(mdi.application)
 }
 
-// getIdentifierKey gets metadata file path key by @mdi.application
+// GetFilePathKey will return string format as metadata/path/Version/Group/Side/Application
 func (mdi *MetadataIdentifier) getFilePathKey(params ...string) string {
 	return mdi.BaseMetadataIdentifier.getFilePathKey(mdi.application)
 }
diff --git a/metadata/identifier/service_metadata_identifier.go b/metadata/identifier/service_metadata_identifier.go
index b89641caa..9325719c4 100644
--- a/metadata/identifier/service_metadata_identifier.go
+++ b/metadata/identifier/service_metadata_identifier.go
@@ -21,18 +21,19 @@ import (
 	"github.com/apache/dubbo-go/common/constant"
 )
 
+// ServiceMetadataIdentifier is inherit baseMetaIdentifier with service params: Revision and Protocol
 type ServiceMetadataIdentifier struct {
 	revision string
 	protocol string
 	BaseMetadataIdentifier
 }
 
-// getIdentifierKey gets metadata identifier key by @mdi.protocol and @mdi.revision
+// GetIdentifierKey will return string format as service:Version:Group:Side:Protocol:"revision"+Revision
 func (mdi *ServiceMetadataIdentifier) getIdentifierKey(params ...string) string {
-	return mdi.BaseMetadataIdentifier.getIdentifierKey(mdi.protocol, constant.KEY_REVISON_PREFIX, mdi.revision)
+	return mdi.BaseMetadataIdentifier.getIdentifierKey(mdi.protocol, constant.KEY_REVISON_PREFIX+mdi.revision)
 }
 
-// getFilePathKey gets metadata file path key by @mdi.protocol and @mdi.revision
+// GetFilePathKey will return string format as metadata/path/Version/Group/Side/Protocol/"revision"+Revision
 func (mdi *ServiceMetadataIdentifier) getFilePathKey(params ...string) string {
-	return mdi.BaseMetadataIdentifier.getFilePathKey(mdi.protocol, constant.KEY_REVISON_PREFIX, mdi.revision)
+	return mdi.BaseMetadataIdentifier.getFilePathKey(mdi.protocol, constant.KEY_REVISON_PREFIX+mdi.revision)
 }
diff --git a/metadata/identifier/subscribe_metadata_identifier.go b/metadata/identifier/subscribe_metadata_identifier.go
index 917e8e630..dd0923d67 100644
--- a/metadata/identifier/subscribe_metadata_identifier.go
+++ b/metadata/identifier/subscribe_metadata_identifier.go
@@ -17,17 +17,18 @@
 
 package identifier
 
+// SubscriberMetadataIdentifier is inherit baseMetaIdentifier with service params: Revision
 type SubscriberMetadataIdentifier struct {
 	revision string
 	BaseMetadataIdentifier
 }
 
-// getIdentifierKey gets metadata identifier key by @mdi.revision
+// GetIdentifierKey will return string format as service:Version:Group:Side:Revision
 func (mdi *SubscriberMetadataIdentifier) getIdentifierKey(params ...string) string {
 	return mdi.BaseMetadataIdentifier.getIdentifierKey(mdi.revision)
 }
 
-// getFilePathKey gets metadata file path key by @mdi.revision
+// GetFilePathKey will return string format as metadata/path/Version/Group/Side/Revision
 func (mdi *SubscriberMetadataIdentifier) getFilePathKey(params ...string) string {
 	return mdi.BaseMetadataIdentifier.getFilePathKey(mdi.revision)
 }
-- 
GitLab