(rawURL string, paramToRemove string)
| 240 | } |
| 241 | |
| 242 | func removeParam(rawURL string, paramToRemove string) (string, string, error) { |
| 243 | // Parse the URL |
| 244 | parsedURL, err := url.Parse(rawURL) |
| 245 | if err != nil { |
| 246 | return "", "", err |
| 247 | } |
| 248 | |
| 249 | // Get current query parameters |
| 250 | query := parsedURL.Query() |
| 251 | ogValue := query.Get(paramToRemove) |
| 252 | |
| 253 | // Check if the parameter exists and remove it |
| 254 | if _, exists := query[paramToRemove]; exists { |
| 255 | query.Del(paramToRemove) |
| 256 | parsedURL.RawQuery = query.Encode() |
| 257 | } |
| 258 | |
| 259 | return parsedURL.String(), ogValue, nil |
| 260 | } |
| 261 | |
| 262 | /* Create a random long integer */ |
| 263 | func randInt() string { |
no outgoing calls
no test coverage detected