Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Tags: variantdev/mod

Tags

v0.25.3

Toggle v0.25.3's commit message
Check HTTP status code in githubreleaseasset getFile before writing t…

…o disk

The getFile function downloads a GitHub release asset to a local file. It
was not checking the HTTP status code before copying the response body to
disk, so a non-2xx response (404 for missing asset, 401 for auth failure)
would silently write the JSON error body as the file content. The sibling
functions getReleaseByTag and getAssetsByReleaseID in the same file
already had proper status checks, making this an inconsistency.

The fix adds a status code check consistent with the other functions in
the file. It also replaces log.Fatal(err) with return err for the request
construction error, since log.Fatal calls os.Exit(1) which bypasses all
deferred cleanup and error handling up the call stack.

An alternative was reading the error response body and including it in the
error message, but for a binary asset download endpoint the error body
format varies, so a status code and URL is sufficient and consistent with
the pattern used by the other functions.

Co-Authored-By: Claude Opus 4.6 <[email protected]>

v0.25.2

Toggle v0.25.2's commit message
Add goreleaser config to disable default windows builds enabled via g…

…oreleaser action update

v0.25.1

Toggle v0.25.1's commit message
Fix list-dependency-versions failing on non-semver since 0.21.0

v0.25.0

Toggle v0.25.0's commit message
feat: Ability to specify host for dockerImageTags dep provider

v0.24.2

Toggle v0.24.2's commit message
Fix failure publishing versioned images

v0.24.1

Toggle v0.24.1's commit message
Fix a few deps to build darwin/arm64

v0.24.0

Toggle v0.24.0's commit message
Bump to Go 1.17

v0.23.0

Toggle v0.23.0's commit message
feat: Download release asset from public and private GitHub repositor…

…ies by tag and asset names

This enhances 7c5edde with a custom go-getter protocol implementation "githubdownload". See the updated README for more information and the usage.

v0.22.2

Toggle v0.22.2's commit message
Fix test

v0.22.1

Toggle v0.22.1's commit message
Fix tests