diff --git a/cli/README.md b/cli/README.md index 600df0dd3..472cc4187 100644 --- a/cli/README.md +++ b/cli/README.md @@ -27,10 +27,20 @@ $ apt-get install -y migrate #### With Go toolchain +##### Unversioned ``` $ go get -tags 'postgres' -u github.com/golang-migrate/migrate/cmd/migrate ``` +##### Versioned + +``` +$ go get -u -d github.com/golang-migrate/migrate/cmd/migrate +$ cd $GOPATH/src/github.com/golang-migrate/migrate/cmd/migrate +$ git checkout $TAG # e.g. v4.1.0 +$ go build -tags 'postgres' -ldflags="-X main.Version=$(git describe --tags)" -o $GOPATH/bin/migrate github.com/golang-migrate/migrate/cmd/migrate +``` + ##### Notes: 1. Requires a version of Go that [supports modules](https://golang.org/cmd/go/#hdr-Preliminary_module_support). e.g. Go 1.11+ 1. This example builds the cli which will only work with postgres. In order