go-check-updates
upgrades your go.mod dependencies to the latest versions, ignoring specified versions.
## Install using brew
brew tap fogfish/go-check-updates https://github.com/fogfish/go-check-updates
brew install -q go-check-updates
## use `brew upgrade` to upgrade to latest version
## Alternatively, install from source code
go install github.com/fogfish/go-check-updates@latest
- Run the command in your Golang repository to check for dependency updates
go-check-updates
- Update dependencies to the latest versions
go-check-updates -u
- Alternatively, you can update dependency and push changes to your git repository. The utility creates a new branch
go-update-deps
.
go-check-updates -u --push origin
- Automate workflow with GitHub Actions to create a pull request every time
go-update-deps
branch is pushed. Craft GitHub Action with following command and install it into your workflow.
go-check-updates generate github > .github/workflows/update-deps.yml
Use the following trigger to activate quality check pipelines when branch go-update-deps
is created.
push:
branches:
- go-update-deps
- /refs/heads/go-update-deps
Golang support easy way to inspect new version of modules:
go list -u \
-f '{{if (and (not (or .Main .Indirect)) .Update)}}{{.Path}}: {{.Version}} -> {{.Update.Version}}{{end}}' \
-m all
## github.com/aws/aws-cdk-go/awscdk/v2: v2.87.0 -> v2.103.1
## github.com/aws/aws-sdk-go-v2: v1.19.0 -> v1.21.2
## github.com/aws/aws-sdk-go-v2/config: v1.18.28 -> v1.19.1
## ...
With following command, it is possible to update go.mod
go list -u \
-f "{{if (and (not (or .Main .Indirect)) .Update)}}go get -d {{.Path}}@{{.Update.Version}} ; {{end}}" \
-m all | sh
## go get -d github.com/aws/aws-cdk-go/awscdk/v2@v2.103.1 ;
## go get -d github.com/aws/aws-sdk-go-v2@v1.21.2 ;
## go get -d github.com/aws/aws-sdk-go-v2/config@v1.19.1 ;
## ...
go-check-update
is the utility that simplify the workflow of running these commands.
go-check-update
is MIT licensed and accepts contributions via GitHub pull requests:
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request