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

Confusing documentation - How to install library... #251

Closed
ohenrik opened this issue Jul 22, 2019 · 4 comments
Closed

Confusing documentation - How to install library... #251

ohenrik opened this issue Jul 22, 2019 · 4 comments

Comments

@ohenrik
Copy link

ohenrik commented Jul 22, 2019

Describe the Bug
I am new to go and though dep ensure was the way to go. However it seems like the migrate package is not compatible with go dep.

So now for the real question. How do i install this? What command do i use? Could you please update the documentation so it is a bit friendlier to new gophers?

Steps to Reproduce
Steps to reproduce the behavior:

  1. Be a noob
  2. Try to get example 1 under "Use in your Go project" to work...

Expected Behavior

  1. type dep ensure or go get
  2. My go program builds like a charm...

Migrate Version
v4??
Obtained by running: migrate -version

@ohenrik
Copy link
Author

ohenrik commented Jul 22, 2019

I got this working now. Firstly i had to run go get alone, however this caused the dependency lib/pg to be downloaded and stored in a global directory, which caused another bug:

panic: sql: Register called twice for driver postgres

Solved this by manually deleting the one installed by dep ensure.

@ohenrik ohenrik closed this as completed Jul 22, 2019
@dhui
Copy link
Member

dhui commented Jul 23, 2019

migrate doesn't support dep for dependency management. We use Go modules.

@eleijonmarck
Copy link

eleijonmarck commented Aug 4, 2019

@dhui could you give an example of how to install the binary using go modules?

I try to install via:

go get -u github.com/golang-migrate/migrate/v4
package github.com/golang-migrate/migrate/v4: 
cannot find package "github.com/golang-migrate/migrate/v4" in any of:

@dhui
Copy link
Member

dhui commented Aug 5, 2019

@eleijonmarck Are you trying to install the CLI or library?
For the CLI, see: #257 (review)
If you're using migrate as a library, go mod tidy should work if you're using the correct import path.

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