标签: go
如何告诉xml.Marshal或xml.MarshalIndent终止Windows CRLF行尾中的行而不是它现在正在产生的LF?
注意:事实发生后,我尝试运行strings.Replace(s, "\n", "\r\n", -1)和strings.Replace(s, ">\n", ">\r\n", -1)进行转换,但这带来的麻烦多于解决的麻烦。一揽子字符串替换将不起作用。
strings.Replace(s, "\n", "\r\n", -1)
strings.Replace(s, ">\n", ">\r\n", -1)