How to stop json.Marshal from escaping < and>?

后端 未结 5 569
甜味超标
甜味超标 2020-12-24 12:48
package main

import \"fmt\"
import \"encoding/json\"

type Track struct {
    XmlRequest string `json:\"xmlRequest\"`
}

func main() {
    message := new(Track)
            


        
5条回答
  •  北海茫月
    2020-12-24 13:37

    No, you can't.

    A third-party json package might be the choice rather than the std json lib.

    More detail:https://github.com/golang/go/issues/8592

提交回复
热议问题