The CLI's generate command assumes that go.mod is in the current working directory. This is not always true in grafana/grafana.
What
Use go mod edit -json to avoid needing to know the exact path of go.mod. This allows us to fetch whichever go.mod is appropriate for the output path for generated go files.
Why
The CLI's
generate
command assumes thatgo.mod
is in the current working directory. This is not always true ingrafana/grafana
.What
Use
go mod edit -json
to avoid needing to know the exact path ofgo.mod
. This allows us to fetch whichevergo.mod
is appropriate for the output path for generated go files.