代码:
url := "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid="+appid+"&secret="+secret
fmt.Println(url)
appid和secret字符串打印结果正常。
输出结果:
代码:
url := "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid="+appid+"&secret="+secret
fmt.Println(url)
appid和secret字符串打印结果正常。
输出结果:
appid := env1.Get("APPID")
fmt.Printf("type of appid is %T, len of appid is %d\n", appid, len(appid))
secret := env1.Get("SECRET")
fmt.Printf("type of secret is %T, len of secret is %d\n", secret, len(secret))
url := `https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=`+appid+`&secret=`+secret
fmt.Println(url)
1楼 @polaris
appid := env1.Get("APPID")
fmt.Printf("type of appid is %T, len of appid is %d\n", appid, len(appid))
secret := env1.Get("SECRET")
fmt.Printf("type of secret is %T, len of secret is %d\n", secret, len(secret))
url := `https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=`+appid+`&secret=`+secret
fmt.Println(url)