Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

encoding/json: changing '&' to '\u0026' #28453

Closed
felipeweb opened this issue Oct 29, 2018 · 1 comment
Closed

encoding/json: changing '&' to '\u0026' #28453

felipeweb opened this issue Oct 29, 2018 · 1 comment

Comments

@felipeweb
Copy link

@felipeweb felipeweb commented Oct 29, 2018

What did you do?

I am just trying to encode to json a struct that has an URL as string field

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

What did you expect to see?

{"url":"https://www.example.com?field1=test&field2=test2"}

What did you see instead?

{"url":"https://www.example.com?field1=test\u0026field2=test2"}

System details

go version go1.11.1 darwin/amd64
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/felipeweb/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/felipeweb/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.11.1/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.11.1/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/felipeweb/go/src/github.com/funccloud/auth/go.mod"
GOROOT/bin/go version: go version go1.11.1 darwin/amd64
GOROOT/bin/go tool compile -V: compile version go1.11.1
uname -v: Darwin Kernel Version 18.0.0: Wed Aug 22 20:13:40 PDT 2018; root:xnu-4903.201.2~1/RELEASE_X86_64
ProductName:	Mac OS X
ProductVersion:	10.14
BuildVersion:	18A391
lldb --version: lldb-1000.0.37
  Swift-4.2
@dominikh

This comment has been minimized.

@dominikh dominikh closed this Oct 29, 2018
@golang golang locked and limited conversation to collaborators Oct 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.