var urlStr string = "https://www.baidu.com" escapeUrl := url.QueryEscape(urlStr) fmt.Println("编码:",escapeUrl) enEscapeUrl, _ := url.QueryUnescape(escapeUrl) fmt.Println("解码:",enEscapeUrl)