diff --git a/common/url.go b/common/url.go index 2edd71affcda1a1626ba9b98a0d3979f1c8bba86..1ea2bc4321afcf93f148fea07019a892966fd720 100644 --- a/common/url.go +++ b/common/url.go @@ -435,6 +435,13 @@ func (c *URL) SetParam(key string, value string) { c.params.Set(key, value) } +// DelParam will delete the given key from the url +func (c *URL) DelParam(key string) { + c.paramsLock.Lock() + defer c.paramsLock.Unlock() + c.params.Del(key) +} + // ReplaceParams will replace the URL.params // usually it should only be invoked when you want to modify an url, such as MergeURL func (c *URL) ReplaceParams(param url.Values) {