Thanks for the reply, but I'm not sure what exactly what you mean.

In my example it's not that I need to `go get` anything for my locally 
stored packages (so I don't need to get `github.com/joe/b`). Rather, I need 
`go get` for other packages. But it (`go get`) fails on the local stored 
packages (`github.com/joe/b` in the example), it doesn't fetch the other 
packages either. Does it make sense ?

Would you mind clarifying ?

Btw, I tried `go mod tidy` in the `~/work/a` directory, in the example I 
created and I get:

```
$ go mod tidy
go: finding module for package github.com/joe/b
github.com/joe/a imports
        github.com/joe/b: cannot find module providing package 
github.com/joe/b: module github.com/joe/b: git ls-remote -q origin in 
/home/janpf/src/go/pkg/mod/cache/vcs/ec7e851af7fd4aeb2a38ed2f81b738f5af4402954d5c2f4c363f5fb9f1b4583c:
 
exit status 128:
        fatal: could not read Username for 'https://github.com': terminal 
prompts disabled
Confirm the import path was entered correctly.
If this is a private repository, see https://golang.org/doc/faq#git_https 
for additional information.
```

In my case let's assume I modify my program `~/work/a/main.go` to use an 
external library:

```
$ cat ~/work/a/main.go
package main
import (
        "fmt"
        "github.com/joe/b"
        "github.com/janpfeifer/gonb/gonbui"
)

func main() {
        fmt.Printf("Hello from joe/a!\n")
        b.Message()
        fmt.Printf("IsNotebook: %v\n", gonbui.IsNotebook)
}
```

Now I want `go get` to fetch me the `gonbui` package:

```
$ go get
github.com/joe/a imports
        github.com/joe/b: cannot find module providing package 
github.com/joe/b
```

It fails, and hence my program doesn't run. Same with `go mod tidy`, which 
also fails.

Any ideas ?






On Tuesday, July 11, 2023 at 2:46:11 PM UTC+2 Howard C. Shaw III wrote:

> I don't think you need to run go get there at all - just run go mod tidy, 
> and then when you go build, if it needs something it will get it. If you 
> need to download without building, go mod download will do that.
>
> Howard
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/c052e39d-109b-4d8c-9ac9-94a5b19d4b8fn%40googlegroups.com.

Reply via email to