hedwigz/entviz

"internal error" on go1.18 due to out of date transitive x/tools dependency

willbicks opened this issue · 1 comments

When trying today to use /cmd/entviz for the first time, I ran into the following error:

$ entviz ./ent/schema
2022/06/11 16:01:21 internal error: package "context" without types was imported from "entgo.io/ent"

Digging further, it appears that this is an issue caused by an outdated version of golang.org/x/tools which lacks support for go1.18. This dependency is present in entgo.io/ent versions < v0.10.0, but later versions upgrade this dependency and fix the issue. (See discussion here: ent/ent#2155).

Running the following two commands in a local clone of this repository before re-installing the package fixed the issue.

go get entgo.io/ent@latest
go mod tidy

I'm not sure if upgrading ent has the potential to break backwards compatibility, but if not I can open a PR to merge these changes.

Hey @willbicks thanks for this detailed report!
It shouldn't be a problem to upgrade ent so feel free to open a PR :)