Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble installing cli for postgres #67

Closed
aebie opened this issue Jun 27, 2018 · 6 comments
Closed

Trouble installing cli for postgres #67

aebie opened this issue Jun 27, 2018 · 6 comments

Comments

@aebie
Copy link

aebie commented Jun 27, 2018

I am trying to try out the migrate CLI, and am running into a problem with the installation steps in the README. I run these commands:

$ go get -u -d github.com/golang-migrate/migrate/cli github.com/lib/pq
$ go build -tags 'postgres' -o /usr/local/bin/migrate github.com/golang-migrate/migrate/cli
go build github.com/golang-migrate/migrate/database/postgres: no buildable Go source files in {GOPATH}/src/github.com/golang-migrate/migrate/database/postgres

If I run the go build with a tag other than postgres it works.

@aebie
Copy link
Author

aebie commented Jun 27, 2018

It looks like the problem I am having is the "// +build go1.9" in the postgres.go file. Maybe document that postgres requires go 1.9?

@dhui
Copy link
Member

dhui commented Jun 27, 2018

Good sleuthing! I'm not sure if it's worth documenting the build constraints as the docs will probably diverge from from the code. Also, we're planning to remove the build constraints, so there won't be anything to document in the future: #60

I recommend you use the latest version of Go, since only the latest 2 major versions of Go are supported by Google (e.g. gets security fixes). https://golang.org/doc/devel/release.html#policy
To ease support, migrate only supports the supported versions of Go.

@dhui
Copy link
Member

dhui commented Jun 27, 2018

Also, migrate is using dep to manage dependencies. I'd use dep (or vgo) to manage your dependencies instead of go get.

The docs mentioning go get should be updated though...

@aebie
Copy link
Author

aebie commented Jun 27, 2018

Thanks, makes sense. I've upgraded to go 1.9 and now it works. Also, noticed another issue opened today that appears to be the same problem.

dhui added a commit that referenced this issue Jun 27, 2018
    - Addresses: #67
    - Add badge for supported Go versions
    - Suggest dep for dependency management
@dhui dhui closed this as completed Jun 28, 2018
@maier-stefan
Copy link

@dhui I'm running in kind of the same issue. As I'm use currently a Dockerfile FROM golang:onbuild So am I right, that i can not do this anymore when using golang-migrate and have to start doing vendoring with dep?

@dhui
Copy link
Member

dhui commented Jul 16, 2018

@maier-stefan Your issue seems unrelated to this one. Please open a new issue with more information (e.g. your full Dockerfile and the error message you're getting) and we'll proceed from there.

FPiety0521 pushed a commit to FPiety0521/Golang-SQL that referenced this issue May 24, 2023
    - Addresses: golang-migrate/migrate#67
    - Add badge for supported Go versions
    - Suggest dep for dependency management
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants