Skip to content

Package not with "go install" installable #202

Open

Description

@bluebrown

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'.

Activity

  1. shilkin commented on Dec 23, 2021

    @shilkin

    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/sql-migrate@v1.0.0
    

    would be nice

    Dear maintainers WDYT? @rubenv

  2. bluebrown commented on Dec 23, 2021

    @bluebrown
    Author

    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
  3. rubenv commented on Dec 23, 2021

    @rubenv
    Owner
  4. rubenv commented on Dec 23, 2021

    @rubenv
    Owner

    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!

  5. alhamsya commented on Jan 3, 2022

    @alhamsya

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions