ソースを参照

added networking access fatal error message

master
Patrick Peng Sun 8年前
コミット
1a5557d04b
1個のファイルの変更3行の追加0行の削除
  1. +3
    -0
      accessToken.go

+ 3
- 0
accessToken.go ファイルの表示

@@ -70,8 +70,11 @@ func renewAuthToken() (AuthToken, error) {
//url := "http://vimeo.com/api/v2/brad/info.json"
url := fmt.Sprintf("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=%s&secret=%s", APIConfig.Appid, APIConfig.AppSecret)
var myClient = &http.Client{Timeout: 20 * time.Second}
log.Println("renew access token from Internet api.weixin.qq.com")
r, err := myClient.Get(url)
if err != nil {
log.Fatal("http access api.weixin.qq.com failed")
log.Fatal(err)
return AuthToken{}, err
}
defer r.Body.Close()

読み込み中…
キャンセル
保存