Skip to content
Snippets Groups Projects
Commit e4eb1f6d authored by Joe Zou's avatar Joe Zou Committed by 邹毅贤
Browse files

Merge pull request #944 from georgehao/develop

fix:  URL.String() data race panic
parent a347a049
Branches
Tags
No related merge requests found
...@@ -317,6 +317,8 @@ func isMatchCategory(category1 string, category2 string) bool { ...@@ -317,6 +317,8 @@ func isMatchCategory(category1 string, category2 string) bool {
} }
func (c *URL) String() string { func (c *URL) String() string {
c.paramsLock.Lock()
defer c.paramsLock.Unlock()
var buf strings.Builder var buf strings.Builder
if len(c.Username) == 0 && len(c.Password) == 0 { if len(c.Username) == 0 && len(c.Password) == 0 {
buf.WriteString(fmt.Sprintf("%s://%s:%s%s?", c.Protocol, c.Ip, c.Port, c.Path)) buf.WriteString(fmt.Sprintf("%s://%s:%s%s?", c.Protocol, c.Ip, c.Port, c.Path))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment