commander-cli / commander

Test your command line interfaces on windows, linux and osx and nodes viá ssh and docker
MIT License
226 stars 19 forks source link

documented install command fails with go 1.16 #166

Closed rene00 closed 3 years ago

rene00 commented 3 years ago

Prerequisites

Description

When attempting to install commander using go get outside of the commander project directory, it fails.

$ cd && go clean -cache -modcache && go get github.com/commander-cli/commander/cmd/commander
go get: github.com/commander-cli/commander@none updating to
        github.com/commander-cli/commander@v1.3.0: parsing go.mod:
        module declares its path as: github.com/SimonBaeumer/commander
                but was required as: github.com/commander-cli/commander

Running the go get command within the commander project directory completes successfully:

$ git clone https://github.com/commander-cli/commander && cd commander &&  go clean -cache -modcache && go get github.com/commander-cli/commander/cmd/commander

Steps to Reproduce

  1. Install go 1.16.
  2. Attempt to install commander outside project directory:
    cd && go clean -cache -modcache -i -r && go get github.com/commander-cli/commander/cmd/commander

    Expected behavior: A working commander binary installed in GOBIN.

Actual behavior: go get fails.

Specifications

You can get the version information from executing commander --version.

rene00 commented 3 years ago

When setting GO111MODULE=auto or GO111MODULE=off, go get completes successfully:

$ cd && go clean -cache -modcache && GO111MODULE=auto go get github.com/commander-cli/commander/cmd/commander
dylanhitt commented 3 years ago

Hey @rene00 would you mind trying to recreate this again? I am unable to do so after #167 was merged

dylanhitt commented 3 years ago

Nevermind, I just reproduced it.

rodrigoaguilera commented 3 years ago

@dylanhitt Does this require a release to be really solved? running

go get github.com/commander-cli/commander/cmd/commander

on a fresh golang docker container I still get the error.

dylanhitt commented 3 years ago

@rodrigoaguilera that's more than likely the case as the following works:

root@a518f274a58a:/go# go get github.com/commander-cli/commander/v2/cmd/commander@master

I think we also would need to change the docs to represent the v2 module. Like

go get github.com/commander-cli/commander/v2/cmd/commander

I can get a PR setup for a v2.5.0 release as we have some features pending.

Thank you for bringing this up.