Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

goda complains about needing a go mod tidy that is never enough #69

Open
soypat opened this issue Apr 21, 2023 · 2 comments
Open

goda complains about needing a go mod tidy that is never enough #69

soypat opened this issue Apr 21, 2023 · 2 comments

Comments

@soypat
Copy link

soypat commented Apr 21, 2023

What happened

Ran goda in my repository, got a message:

$ goda graph -std "reach(github.com/...:all, flag)" | dot -Tsvg -o graph.svg
err: exit status 1: stderr: go: updates to go.mod needed; to update it:
        go mod tidy

Running go mod tidy does not fix the problem.

Deleting go.sum fixes the issue.

Steps to replicate

using go19.3:
main.go contents:

package main

import (
	"golang.org/x/exp/slog"
	"periph.io/x/host/v3"
)

func main() {
	slog.Any("", "")
	host.Init()
}
  1. Run go mod init something
  2. Run go mod tidy
  3. Run goda graph -std "reach(github.com/...:all, flag)"

Generated go.mod file

module tg

go 1.19

require (
	golang.org/x/exp v0.0.0-20230420155640-133eef4313cb
	periph.io/x/host/v3 v3.8.0
)

require periph.io/x/conn/v3 v3.7.0 // indirect

Generated go.sum:

github.com/jonboulle/clockwork v0.3.0 h1:9BSCMi8C+0qdApAp4auwX0RkLGUjs956h0EkuQymUhg=
golang.org/x/exp v0.0.0-20230420155640-133eef4313cb h1:rhjz/8Mbfa8xROFiH+MQphmAmgqRM0bOMnytznhWEXk=
golang.org/x/exp v0.0.0-20230420155640-133eef4313cb/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w=
periph.io/x/conn/v3 v3.7.0 h1:f1EXLn4pkf7AEWwkol2gilCNZ0ElY+bxS4WE2PQXfrA=
periph.io/x/conn/v3 v3.7.0/go.mod h1:ypY7UVxgDbP9PJGwFSVelRRagxyXYfttVh7hJZUHEhg=
periph.io/x/host/v3 v3.8.0 h1:T5ojZ2wvnZHGPS4h95N2ZpcCyHnsvH3YRZ1UUUiv5CQ=
periph.io/x/host/v3 v3.8.0/go.mod h1:rzOLH+2g9bhc6pWZrkCrmytD4igwQ2vxFw6Wn6ZOlLY=
@egonelbre
Copy link
Member

egonelbre commented Apr 21, 2023

I just realized what's going wrong:

goda graph -std "reach(github.com/...:all, flag)" | dot -Tsvg -o graph.svg
                       ^--- implies loading all modules from github

This should work:

goda graph -std "reach(./...:all, flag)" | dot -Tsvg -o graph.svg

I'll need to figure out why it's giving that error and whether there's a way I can output a better error.

This gives the same error btw.:

go list github.com/...

@soypat
Copy link
Author

soypat commented Apr 21, 2023

Filed! golang/go#59755

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants