Skip to content
Snippets Groups Projects
Commit ae028f9e authored by vito.he's avatar vito.he
Browse files

Mod:format

parent 06b6cf82
No related branches found
No related tags found
No related merge requests found
......@@ -69,9 +69,9 @@ type baseUrl struct {
Location string // ip+port
Ip string
Port string
Params url.Values
//url.Values is not safe map, add to avoid concurrent map read and map write error
paramsLock sync.RWMutex
Params url.Values
PrimitiveURL string
ctx context.Context
}
......@@ -294,7 +294,7 @@ func (c *URL) AddParam(key string, value string) {
func (c URL) GetParam(s string, d string) string {
var r string
c.paramsLock.RLock()
if r = c.Params.Get(s); r == "" {
if r = c.Params.Get(s); len(r) == 0 {
r = d
}
c.paramsLock.RUnlock()
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment