Skip to content

net/url: regression after #22907 fixed #27302

Closed
@ayanamist

Description

@ayanamist

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version devel +76c4587 Tue Aug 28 09:26:45 2018 +0000 linux/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOCACHE="/home/tianyang.yty/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/tianyang.yty/go"
GOPROXY=""
GORACE=""
GOROOT="/home/tianyang.yty/gobuild/go"
GOTMPDIR=""
GOTOOLDIR="/home/tianyang.yty/gobuild/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
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-build461801575=/tmp/go-build -gno-record-gcc-switches"

What did you do?

https://play.golang.org/p/bScfUelhUmE

What did you expect to see?

2009/11/10 23:00:00 RawQuery array[]=first&array[]=second
2009/11/10 23:00:00 url.Values{"array[]":[]string{"first", "second"}}

What did you see instead?

2018/08/28 19:57:03 RawQuery array%5B%5D%3Dfirst%26array%5B%5D%3Dsecond
2018/08/28 19:57:03 url.Values{"array[]=first&array[]=second":[]string{""}}

Many javascript framework, like jquery, will append [] to param keys, in current and previous stable release, this works fine, but after 1040626 fix #22907 pushed to master, this backward compatibility has been broken.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions