我正在使用谷歌从我的gcp获取一些信息。我需要设置超时,因为请求花费的时间太长。我试图像这样设置它idtoken.NewClient
Timeout: time.Second * 10,
Transport: http.DefaultTransport,
}
options := idtoken.WithHTTPClient(netClient)
// client is a http.Client that automatically adds an "Authorization" header
// to any requests made.
client, err := idtoken.NewClient(ctx, targetURL, options)
但我得到以下错误:idtoken.NewClient: transport/http: WithHTTPClient passed to NewTransport
我不知道如何设置此选项
海绵宝宝撒
相关分类