golang-migrate / migrate

Database migrations. CLI and Golang library.
Other
15.58k stars 1.41k forks source link

CLI Install instructions are incorrect for Go 1.16+ #603

Open aastein opened 3 years ago

aastein commented 3 years ago

Describe the Bug The CLI instruction list this step for go 1.16+ https://github.com/golang-migrate/migrate/tree/master/cmd/migrate go install -tags 'postgres' -o $GOPATH/bin/migrate github.com/golang-migrate/migrate/v4/cmd/migrate@$TAG However the go install command has no -o option.

Also the initial go get command does not work

aaron@local bin % go get -u -d github.com/golang-migrate/migrate/cmd/migrate
go get: module github.com/golang-migrate/migrate@upgrade found (v3.5.4+incompatible), but does not contain package github.com/golang-migrate/migrate/cmd/migrate

Steps to Reproduce Steps to reproduce the behavior:

  1. My migrations look like '...'
  2. I ran migrate with the following options '....'
  3. See error

Expected Behavior A clear and concise description of what you expected to happen.

Migrate Version e.g. v3.4.0 Obtained by running: migrate -version

Loaded Source Drivers e.g. s3, github, go-bindata, gcs, file Obtained by running: migrate -help

Loaded Database Drivers e.g. spanner, stub, clickhouse, cockroachdb, crdb-postgres, postgres, postgresql, pgx, redshift, cassandra, cockroach, mysql Obtained by running: migrate -help

Go Version e.g. go version go1.11 linux/amd64 Obtained by running: go version

Stacktrace Please provide if available

Additional context Add any other context about the problem here.

dhui commented 3 years ago

Are you using Go 1.11 with the Go 1.16+ method for installing the CLI?

Also, have you read the notes for installing via the Go toolchain? Namely, are you installing the CLI within a module?

However the go install command has no -o option.

Good point! I'll fix that. Have you tried go install without the -o option?