grafana / grafana-app-sdk

An SDK for developing apps for grafana using kubernetes-like storage and operators
Apache License 2.0
48 stars 8 forks source link

CLI: Fix go.mod path issue in generate #448

Closed toddtreece closed 1 month ago

toddtreece commented 1 month ago

Why

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.