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 2022/09/16 02:17:39 UTC
[GitHub] [dubbo-go] baerwang commented on a diff in pull request #2022: Fix service discovery related issues and add mesh proxy mode support
baerwang commented on code in PR #2022:
URL: https://github.com/apache/dubbo-go/pull/2022#discussion_r972552035
##########
common/url.go:
##########
@@ -515,6 +530,23 @@ func (c *URL) GetParam(s string, d string) string {
return r
}
+// GetParamNoDefault gets value by key, return nil,false if no value found mapping to the key
+func (c *URL) GetParamNoDefault(s string) (string, bool) {
+ c.paramsLock.RLock()
+ defer c.paramsLock.RUnlock()
+
+ var r string
+ ok := true
+ if len(c.params) > 0 {
+ r = c.params.Get(s)
+ }
+ if len(r) == 0 {
+ ok = false
+ }
+
+ return r, ok
Review Comment:
这个是不是多余了?直接判断是否为空字符串不就好了吗?
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
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