Skip to content

pre-modules go get replacement needed, as it won't work outside of existsing module with modules enabled #27380

Closed
@sirkon

Description

@sirkon

So, I am currently using official build (that tgz file) for Linux with export GO111MODULE=on. And I am having troubles building binaries in a old way outside of any existing module:

$ go get golang.org/x/tools/cmd/goimports
go: cannot find main module; see 'go help modules'

As you see, I am trying to download and build goimports and then put the binary into $GOPATH/bin with this go get call. Thus, we are having obvious usability downgrade. Everything is OK when I do this inside some existing module, BTW.

I believe there should be some kind of replacement. It is clear go get is not the best place for this sort of functionality after go modules enabled. I guess there should be a new command specially for this case.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions