go get - no package to get in current directory

673 views
Skip to first unread message

Björn Försterling

unread,
Mar 6, 2025, 1:34:41 AMMar 6
to golang-nuts
Hello,

when trying to "go get" inside the "golang/tools" module (golang.org/x/tools) I cannot download any Go files:
.../golang/tools (master) $ GOMODCACHE="$(pwd)/.godeps" go get
go: no package to get in current directory

It only gives me a dir structure with go.mod files and version numbers:
cache
    └── download
        ├── github.com
        │   ├── google
        │   │   └── go-cmp
        │   │       └── @v
        │   │           ├── list
        │   │           └── v0.6.0.mod

Usually this git clones the entire dependenices with all the Go files.
Is this because Google's repos are not Git repos?
There must be a way to get all dependencies and all the Go files.

Regards
Bjoern

Elrefaei Mohammed

unread,
Mar 6, 2025, 8:36:01 AMMar 6
to Björn Försterling, golang-nuts

Can u tell me how can I fix this issues


--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/golang-nuts/CA%2BD_Ns9gvDh3_16W4whkLm-hXqbvELhLPF3_qUBKi1BCVAavuw%40mail.gmail.com.

Ian Lance Taylor

unread,
Mar 6, 2025, 10:20:17 AMMar 6
to Björn Försterling, golang-nuts
On Wed, Mar 5, 2025 at 10:34 PM Björn Försterling
<bjoern.fo...@gmail.com> wrote:
>
> when trying to "go get" inside the "golang/tools" module (golang.org/x/tools) I cannot download any Go files:
> .../golang/tools (master) $ GOMODCACHE="$(pwd)/.godeps" go get
> go: no package to get in current directory

Well, that is true: there is no package at the top level of golang.org/x/tools.

> It only gives me a dir structure with go.mod files and version numbers:
> cache
> └── download
> ├── github.com
> │ ├── google
> │ │ └── go-cmp
> │ │ └── @v
> │ │ ├── list
> │ │ └── v0.6.0.mod
>
> Usually this git clones the entire dependenices with all the Go files.
> Is this because Google's repos are not Git repos?
> There must be a way to get all dependencies and all the Go files.

To fetch all the dependencies of all the packages in x/tools, use "go
get ./...".

Ian
Reply all
Reply to author
Forward
0 new messages