https://pantsbuild.org/ logo
#general
Title
# general
l

loud-laptop-17949

12/14/2021, 8:59 PM
Does the Go support include
go generate
yet? I can't seem to find it in the docs or any issues tracking it.
f

fast-nail-55400

12/14/2021, 9:04 PM
It doesn’t. I’ll open an issue.
although given that
go generate
is never run automatically, it should still work with Pants by just invoking
go generate
independently and checking in those sources
going by the help text:
Copy code
Go generate is never run automatically by go build, go get, go test,
and so on. It must be run explicitly.
l

loud-laptop-17949

12/14/2021, 9:30 PM
yeah, I was thinking that pants should run it, yeah?
f

fast-nail-55400

12/14/2021, 9:36 PM
eventually maybe. for at least 2.9 and 2.10, Pants still relies on the Go tooling for certain operations including managing the go.mod/go.sum files. given how
go generate
is a manual step outside of the direct build of binaries/packages, we’d probably not support in the near term.
👍 1
(since the work around is to just invoke
go generate
and Pants can still work with the generated files)
what use case were you envisioning?
for example, if it were for protobuf/thrift code generation, then that use case is better supported by teaching the Go backend to generate Go sources from protobuf files directly, just like the Python backend (and soon this week the Scala backend) can do
👍 1
h

hundreds-father-404

12/14/2021, 9:39 PM
Is generate usually run as a one time operation, or you continue running the same transformations repeatedly? Like that you'd hook up to ./pants fmt?