---
title: "url-query-copy-mutation"
description: "Detect mutations of the temporary copy returned by URL.Query."
image: "https://strider.gempir.com/og.png"
---

> Documentation Index
> Fetch the complete documentation index at: https://strider.gempir.com/llms.txt
> Use this file to discover all available pages before exploring further.

# url-query-copy-mutation

**Default severity:** `warning`

`URL.Query` parses `RawQuery` and returns a new `Values` map. Mutating that
temporary map does not update the URL unless the encoded result is assigned
back to `RawQuery`.

## Bad

```go
address.Query().Set(key, value)
```

## Good

```go
values := address.Query(); values.Set(key, value); address.RawQuery = values.Encode()
```

Source: https://strider.gempir.com/analyzers/url-query-copy-mutation/index.mdx
