When using pants to build `go` code, has anyone ha...
# general
l
When using pants to build
go
code, has anyone had success importing the
runtime/debug
package to call
ReadBuildInfo()
to access
vcs.revision
? Based on the pants docs: > You can also package your binaries (aka
go build
) by using
pants package
.
package ::
will build all your project’s binaries… the build info should be available by running
go build
(assuming pants runs the cmd behind the scenes), but the build info doesn’t seem to be embedded in the binary
that is, you can normally run:
Copy code
go build -o main .
and see:
Copy code
vcs:	git
  vcs.revision:	4071203188d039a852220d88dad45df0dbfaae7a
  vcs.time:	2023-08-10T16:47:19Z
  vcs.modified:	true
but, not the case when building with pants