]> Cypherpunks.ru repositories - gostls13.git/commit
net/url: improve url parsing error messages by quoting
authorStefan Baebler <sbaebler@outbrain.com>
Wed, 28 Aug 2019 12:10:16 +0000 (12:10 +0000)
committerDaniel Martí <mvdan@mvdan.cc>
Wed, 28 Aug 2019 12:47:06 +0000 (12:47 +0000)
commit64cfe9fe22113cd6bc05a2c5d0cbe872b1b57860
tree1a4e055c0dd138ced384911a01db0d25724cdb63
parent5fb74fc13853b950b5102ef26d665db97f4838fd
net/url: improve url parsing error messages by quoting

Current implementation doesn't always make it obvious what the exact
problem with the URL is, so this makes it clearer by consistently quoting
the invalid URL, as is the norm in other parsing implementations, eg.:
strconv.Atoi(" 123") returns an error: parsing " 123": invalid syntax

Updates #29261

Change-Id: Icc6bff8b4a4584677c0f769992823e6e1e0d397d
GitHub-Last-Rev: 648b9d93fe149ec90f3aeca73019158a344de03e
GitHub-Pull-Request: golang/go#29384
Reviewed-on: https://go-review.googlesource.com/c/go/+/185117
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/net/http/client_test.go
src/net/http/readrequest_test.go
src/net/url/url.go
src/net/url/url_test.go