exercism/cli

Error when using go get

avi-vivi opened this issue ยท 3 comments

Hello,
When I run the command

go get github.com/exercism/cli/exercism

I get the following error(s):

cannot find package "github.com/hashicorp/hcl/hcl/printer" in any of:
        /usr/local/go/src/github.com/hashicorp/hcl/hcl/printer (from $GOROOT)
        /Users/vivi/go/src/github.com/hashicorp/hcl/hcl/printer (from $GOPATH)

How to fix this?
Thanks.

kotp commented

The error message says that the package is not in either of se locations. And that it checked the environment variable named GOROOT to know where to look.

You can choose to add another location to that environment variable, or you can clone that project to one of the locations listed in the message.

I hope that helps.

NobbZ commented
go get github.com/exercism/cli/exercism

As far as I remember, this won't work properly for modules, as the module description isn't found that way and go might fall back to old dependency resolution, which is "pick latest of everything".

If you really want to build from source, please git clone the repository and then run go build -o exercism-bin exercism/main.go from the root of your clone.

Be aware that you need at least go 1.11 to get all required features for the build, also if you are not using 1.13 or newer, you might need to manually enable go modules first and translate some of the calls to old-style experimental interface.

Thanks, it works now