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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]