package main
import (
"fmt"
)
func main(){
// %d 表示整形数字 %s 表示字符串
var stockcode = 123
var enddate = "2021-12-31"
var url = "Code=%d&endDate=%s"
var target_url = fmt.sprintf(url,stockcode,enddate)
fmt.Println(target_url)
}
// Code = 123&endDate="2021-12-31"
fmt.sprintf 格式化字符串并赋值给新串