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 2020/11/19 10:28:26 UTC

[GitHub] [dubbo-go] bonake commented on issue #884: config.Load()加载client.yml时偶尔会出现错误:fatal error: concurrent map read and map write

bonake commented on issue #884:
URL: https://github.com/apache/dubbo-go/issues/884#issuecomment-730279005


   github.com/apache/dubbo-go@v1.5.4/common/url.go 中的map访问是否可以考虑加锁
   // RangeParams will iterate the params
   // it's not thread-safe
   func (c *URL) RangeParams(f func(key, value string) bool) {
   	for k, v := range c.params {
   		if !f(k, v[0]) {
   			break
   		}
   	}
   }
   
   // GetParam gets value by key
   func (c URL) GetParam(s string, d string) string {
   	r := c.params.Get(s)
   	if len(r) == 0 {
   		r = d
   	}
   	return r
   }


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