Home

Awesome

Go Check Updates

go-check-updates upgrades your go.mod dependencies to the latest versions, ignoring specified versions.

Quick Start

  1. Install utility using either from Homebrew or GitHub.
## 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
  1. Run the command in your Golang repository to check for dependency updates
go-check-updates
  1. Update dependencies to the latest versions
go-check-updates -u
  1. 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
  1. 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

Inspiration

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.

How To Contribute

go-check-update is MIT licensed and accepts contributions via GitHub pull requests:

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

License

See LICENSE