chainguard-dev / gobump

Go tool to declaratively bump dependencies.
Apache License 2.0
7 stars 11 forks source link

GoBump

GoBump is a simple command-line tool written in Go that allows you to update the versions of your Go dependencies.

Usage

gobump --packages=<package@version> ... --modroot=<path to go.mod>

Flags

Example

Using flags

gobump --packages="github.com/pkg/errors@v0.9.1 golang.org/x/mod@v0.4.2" --modroot=/path/to/your/project

This will update the versions of github.com/pkg/errors and golang.org/x/mod in your go.mod file.

Using file

Create a file bumps.yaml

packages:
  - name: github.com/pkg/errors
    version: v0.9.1
  - name: golang.org/x/mod
    version: v0.4.2

And it does the same as above flags. You can also specify replace and require in the yaml fields. Some examples. Note Index field is not used.

Requirements

Go 1.20 or later

Installation

To install gobump, you can use go install:

go install github.com/chainguard-dev/gobump@latest

Contributing

Contributions are welcome! Please submit a pull request on GitHub.