摘要: 转自:golang:base64编解码 Go 语言的标准库自带了 Base64 编码算法,通过几行代码就可以对数据进行编码 编解码字符串 package main import ( "encoding/base64" "fmt" ) func main() { // 需要处理的字符串 message 阅读全文
posted @ 2022-08-09 14:47 Lucky小黄人^_^ 阅读(732) 评论(0) 推荐(0)
摘要: 转自:goland json.Marshal导致&变成\u0026 **背景:**goland后台使用json.Marshal转换时,会将<,>,&转化为unicode编码,导致入库时&变成\u0026。 原因: json.marshal默认escapeHtml为true,会将<、>、&等字符转义。 阅读全文
posted @ 2022-08-09 14:41 Lucky小黄人^_^ 阅读(2018) 评论(0) 推荐(0)
摘要: 转自:golang中的urlEncode package main import( "fmt" "net/url" ) func main() { var urlStr string = "https://www.baidu.com" escapeUrl := url.QueryEscape(url 阅读全文
posted @ 2022-08-09 14:25 Lucky小黄人^_^ 阅读(632) 评论(0) 推荐(0)