@@ -188,16 +188,16 @@ func updateClient(timeout time.Duration) *http.Client {
188188 return & clone
189189}
190190
191- func fetchLatestGitHubRelease (ctx context.Context , client * http.Client , url string ) (githubRelease , error ) {
191+ func fetchLatestGitHubRelease (ctx context.Context , client * http.Client , endpoint string ) (githubRelease , error ) {
192192 var release githubRelease
193- apiErr := fetchUpdateJSON (ctx , client , url , & release )
193+ apiErr := fetchUpdateJSON (ctx , client , endpoint , & release )
194194 if apiErr == nil {
195195 return release , nil
196196 }
197197
198198 fallback , fallbackErr := fetchLatestGitHubReleaseRedirect (ctx , client , updateLatestWebURL )
199199 if fallbackErr != nil {
200- return githubRelease {}, fmt .Errorf ("fetch latest release: API: %v ; web fallback: %w" , apiErr , fallbackErr )
200+ return githubRelease {}, fmt .Errorf ("fetch latest release: API: %s ; web fallback: %w" , apiErr . Error () , fallbackErr )
201201 }
202202 return fallback , nil
203203}
@@ -258,8 +258,8 @@ func updateReleaseAssetURL(tag string, assetName string) string {
258258 url .PathEscape (tag ) + "/" + url .PathEscape (assetName )
259259}
260260
261- func fetchUpdateJSON (ctx context.Context , client * http.Client , url string , dst any ) error {
262- req , err := http .NewRequestWithContext (ctx , http .MethodGet , url , nil )
261+ func fetchUpdateJSON (ctx context.Context , client * http.Client , endpoint string , dst any ) error {
262+ req , err := http .NewRequestWithContext (ctx , http .MethodGet , endpoint , nil )
263263 if err != nil {
264264 return err
265265 }
@@ -285,8 +285,8 @@ func fetchUpdateJSON(ctx context.Context, client *http.Client, url string, dst a
285285 return nil
286286}
287287
288- func fetchAssetChecksum (ctx context.Context , client * http.Client , url string , assetName string ) (string , error ) {
289- req , err := http .NewRequestWithContext (ctx , http .MethodGet , url , nil )
288+ func fetchAssetChecksum (ctx context.Context , client * http.Client , endpoint string , assetName string ) (string , error ) {
289+ req , err := http .NewRequestWithContext (ctx , http .MethodGet , endpoint , nil )
290290 if err != nil {
291291 return "" , fmt .Errorf ("fetch checksums.txt: %w" , err )
292292 }
0 commit comments