基本字符串拼接错误

veiky · · 838 次点击
1楼 <a href="/user/polaris" title="@polaris">@polaris</a> ``` appid := env1.Get(&#34;APPID&#34;) fmt.Printf(&#34;type of appid is %T, len of appid is %d\n&#34;, appid, len(appid)) secret := env1.Get(&#34;SECRET&#34;) fmt.Printf(&#34;type of secret is %T, len of secret is %d\n&#34;, secret, len(secret)) url := `https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&amp;appid=`+appid+`&amp;secret=`+secret fmt.Println(url) ``` ![image.png](https://static.studygolang.com/190428/a10761391b688f6f78bbc3acef6d8bd4.png)
#3
更多评论
polaris
社区,需要你我一同完善!
没看出有啥问题
#1
``` appid := env1.Get(&#34;APPID&#34;) fmt.Printf(&#34;type of appid is %T, len of appid is %d\n&#34;, appid, len(appid)) secret := env1.Get(&#34;SECRET&#34;) fmt.Printf(&#34;type of secret is %T, len of secret is %d\n&#34;, secret, len(secret)) url := `https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&amp;appid=`+appid+`&amp;secret=`+secret fmt.Println(url) ``` ![image.png](https://static.studygolang.com/190428/a10761391b688f6f78bbc3acef6d8bd4.png)
#2