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

Package not with "go install" installable #202

Open
bluebrown opened this issue Dec 19, 2021 · 5 comments
Open

Package not with "go install" installable #202

bluebrown opened this issue Dec 19, 2021 · 5 comments

Comments

@bluebrown
Copy link

bluebrown commented Dec 19, 2021

Hi, I would like to use go install, but it didn't work.

$ go install github.com/rubenv/sql-migrate                                                                                                                                                          
go install: version is required when current directory is not in a module
        Try 'go install github.com/rubenv/sql-migrate@latest' to install the latest version

I needed to use the provided command from the docs, but it shows warnings.

$ go get github.com/rubenv/sql-migrate/...
go get: installing executables with 'go get' in module mode is deprecated.
        To adjust and download dependencies of the current module, use 'go get -d'.
        To install using requirements of the current module, use 'go install'.
        To install ignoring the current module, use 'go install' with a version,
        like 'go install example.com/cmd@latest'.
        For more information, see https://golang.org/doc/go-get-install-deprecation
        or run 'go help get' or 'go help install'.
@shilkin
Copy link

shilkin commented Dec 23, 2021

I guess the problem is that sql-migarte doesn't have any releases. In go 1.17 when you use go install to activate modules you just have to specify the version either latest or commit hash.

Using the latest version IMHO is not an option since on CI you are losing the ability to use a fixed version of the tool.
The better way is to issue a release i.e. v1.0.0 and let people use this version instead of latest or confusing commit hash.

go install -v github.com/rubenv/sql-migrate/[email protected]

would be nice

Dear maintainers WDYT? @rubenv

@bluebrown
Copy link
Author

bluebrown commented Dec 23, 2021

I forgot to mention, using @latest did not work.

$ go install github.com/rubenv/sql-migrate@latest
package github.com/rubenv/sql-migrate is not a main package

Edit: I just tried with commit hash, the same issue.

$ go install github.com/rubenv/sql-migrate@9f02b1e13857b68b1357a8302c9b05ff6b70d6c0
package github.com/rubenv/sql-migrate is not a main package

@rubenv
Copy link
Owner

rubenv commented Dec 23, 2021 via email

@rubenv
Copy link
Owner

rubenv commented Dec 23, 2021

I forgot to mention, using @latest did not work.

$ go install github.com/rubenv/sql-migrate@latest
package github.com/rubenv/sql-migrate is not a main package

The executable package is in github.com/rubenv/sql-migrate/sql-migrate, so the path you were using was wrong.

I'll roll a release once I get a chance.

Just pushed v1.0.0!

@alhamsya
Copy link

alhamsya commented Jan 3, 2022

you can try :
go get -v github.com/rubenv/sql-migrate/...@f842348935589e4563be545226d465178bd439cf

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

4 participants