fix: correct checksum flag assignment and add checksum validation #128
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces changes to the handling of checksums in the
gh
package, including the addition of checksum verification for release assets and the removal of redundant checksum code from thesetup
package. The most important changes include the addition of a new checksum function, modifications to theAssetOption
struct, and updates to the tests to cover the new checksum functionality.Checksum verification:
GetReleaseAsset
function to validate the integrity of downloaded assets. (gh/gh.go
, gh/gh.goR86-R92)checksum
function to handle various checksum algorithms and formats. (gh/gh.go
, gh/gh.goR291-R349)Struct and flag updates:
Checksum
field to theAssetOption
struct to store the checksum value for verification. (gh/gh.go
, gh/gh.goR66)rootCmd
flags to use the correctChecksum
field from theopt
struct. (cmd/root.go
, cmd/root.goL120-R120)Test enhancements:
gh/gh_test.go
, gh/gh_test.goR50-R236)Checksum
field in theAssetOption
struct. (gh/gh_test.go
, gh/gh_test.goL25-R29)Code cleanup:
setup
package, as it is now handled in thegh
package. (setup/setup.go
, [1] [2] [3] [4]setup
package. (setup/setup_test.go
, setup/setup_test.goL34-L220)