[go-nuts] Re: go mod tidy doesn't rewrite go.mod file (shows go: warning "all" matched no packages)

2022-04-06 Thread 'Bryan C. Mills' via golang-nuts
Do you have a go.work file? If so, does it include the module in that directory? (Compare https://go.dev/issue/51604.) What do `go env GOMOD` and `go env GOWORK` report? On Friday, April 1, 2022 at 10:05:57 AM UTC-4 vaastav...@gmail.com wrote: > There is definitely source code in that folder.

[go-nuts] Re: go mod tidy doesn't rewrite go.mod file (shows go: warning "all" matched no packages)

2022-04-01 Thread vaastav...@gmail.com
There is definitely source code in that folder. There is a main.go file as well as 3 other packages. So, go.mod should not be removing all the entries from the go.mod file. On Friday, 1 April 2022 at 15:43:30 UTC+2 Brian Candler wrote: > I just updated to 1.18 (from 1.17.6) - on macOS 12.3.1 -

[go-nuts] Re: go mod tidy doesn't rewrite go.mod file (shows go: warning "all" matched no packages)

2022-04-01 Thread Brian Candler
I just updated to 1.18 (from 1.17.6) - on macOS 12.3.1 - and indeed: - with just go.mod, I get the warning and go.mod is cleaned up - with go.mod plus main.go, I get no warning and go.mod is cleaned up This looks to me like a bug fix. If there is no source code, then by definition go.mod should

[go-nuts] Re: go mod tidy doesn't rewrite go.mod file (shows go: warning "all" matched no packages)

2022-04-01 Thread vaastav...@gmail.com
Ok, I just tested this. I only see this behaviour with go 1.18. I tried using go mod tidy with go1.17 and it worked as expected. On Friday, 1 April 2022 at 14:15:14 UTC+2 vaastav...@gmail.com wrote: > I see this behaviour even in the presence of a main.go file in the same > directory. This is

[go-nuts] Re: go mod tidy doesn't rewrite go.mod file (shows go: warning "all" matched no packages)

2022-04-01 Thread vaastav...@gmail.com
I see this behaviour even in the presence of a main.go file in the same directory. This is why I am baffled as to why I am seeing this warning even if the source code is present. It was working fine until I upgraded from go1.17 to go1.18 On Friday, 1 April 2022 at 11:36:04 UTC+2 Brian Candler

[go-nuts] Re: go mod tidy doesn't rewrite go.mod file (shows go: warning "all" matched no packages)

2022-04-01 Thread Brian Candler
Interesting. If I put that go.mod file in an empty directory, then I see the warning: $ go mod tidy go: warning: "all" matched no packages $ go mod tidy go: warning: "all" matched no packages > But when I run `go mod tidy`, it simply prints out the aforementioned warning and the new go.mod

[go-nuts] Re: go mod tidy doesn't rewrite go.mod file (shows go: warning "all" matched no packages)

2022-03-31 Thread vaastav...@gmail.com
Here are the contents of the go.mod file ``` module module_name_obfuscated go 1.18 require ( github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b github.com/go-redis/redis/v8 v8.11.4 github.com/go-sql-driver/mysql v1.6.0 github.com/otiai10/copy v1.7.0

[go-nuts] Re: go mod tidy doesn't rewrite go.mod file (shows go: warning "all" matched no packages)

2022-03-31 Thread Brian Candler
Can you show the contents of the go.mod file in the directory where you run "go mod tidy"? > I get this error when I run `go list all` as well. Try "go list" rather than "go list all" (because in that context, "all" is interpreted as the name of a package) On Thursday, 31 March 2022 at