Repository: go
Issue: net/url: semicolons treated as invalid characters in query string
Labels: NeedsInvestigation

<!--
Please answer these questions before submitting your issue. Thanks!
-->

### What version of Go are you using (`go version`)?

<pre>
$ go version
1.17.1
</pre>

### Does this issue reproduce with the latest release?
Yes


### What operating system and processor architecture are you using (`go env`)?

<details><summary><code>go env</code> Output</summary><br><pre>
$ go env
➜  ~ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/chrisg/.cache/go-build"
GOENV="/home/chrisg/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/chrisg/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/chrisg"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/chrisg/sdk/go1.17.1"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/chrisg/sdk/go1.17.1/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.17.1"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build237025076=/tmp/go-build -gno-record-gcc-switches"
</pre></details>

### What did you do?

<!--
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on go.dev/play is best.
-->

Parsed a url with a non url-encoded semicolon in a value of a query string parameter
https://go.dev/play/p/n68WBqiRmkt

```
	u, err := url.Parse("http://foo.com/?bar=;&baz=foobar&abc&xyz=&ikj=n;m")
	if err != nil {
		panic(err)
	}

	fmt.Printf("%+v\n", u)
	fmt.Printf("%+v\n", u.Query())
	fmt.Printf("%+v\n", u.RawQuery)

	q, err := url.ParseQuery(u.RawQuery)
	if err != nil {
		panic(err)
	}
	fmt.Printf("%+v\n", q)
```

### What did you expect to see?
The value parsed literally, and successfully  - e.g., 

```
map[abc:[] baz:[foobar] xyz:[] bar:[;] ikj=n;m]
```

### What did you see instead?

```
http://foo.com/?bar=;&baz=foobar&abc&xyz=&ikj=n;m
map[abc:[] baz:[foobar] xyz:[]]
bar=;&baz=foobar&abc&xyz=&ikj=n;m
panic: invalid semicolon separator in query

goroutine 1 [running]:
main.main()
	/tmp/sandbox883685007/prog.go:22 +0x1eb

Program exited.
```

There have been a number of issues related to the new semicolon handling (some of which raised by myself):
- https://github.com/golang/go/issues/49683 (closed as a duplicate of  https://github.com/golang/go/issues/47425 -- I don't believe it is)
- https://github.com/golang/go/issues/49399
- https://github.com/golang/go/issues/47425

The original issue, and proposal to add `AllowQuerySemicolons`:
- https://github.com/golang/go/issues/25192
- https://github.com/golang/go/issues/45973


It's not clear why the current behavior has been chosen.  The oringal issue only highlighted semicolons as an issue _as a seperator_.  The current implementation ignores them entirely -- which is incredibly frustrating.

The fact of the matter is that urls containing raw semicolons *do exist* and those parameter values have meaning.

I'd really appreciate if we could have a dialog about potential options.  I'm willing to invest time to do any implementation, but it's not clear to me what the powers that be will find acceptable.

As it stands, the issues introduced by the url parsing change in 1.17 has prevented upgrades at my org.  I'd really like to help find a safe & viable way forward