package main
import \"fmt\"
import \"encoding/json\"
type Track struct {
XmlRequest string `json:\"xmlRequest\"`
}
func main() {
message := new(Track)
In Go1.7 the have added a new option to fix this:
encoding/json: add Encoder.DisableHTMLEscaping This provides a way to disable the escaping of <, >, and & in JSON strings.
The relevant function is
func (*Encoder) SetEscapeHTML
That should be applied to a Encoder.
enc := json.NewEncoder(os.Stdout)
enc.SetEscapeHTML(false)
Simple example: https://play.golang.org/p/SJM3KLkYW-