Skip to content

Commit

Permalink
Merge pull request #3 from UiP9AV6Y/feature/tools_expose_embed
Browse files Browse the repository at this point in the history
expose a clone of the embedded build info for others to use.
  • Loading branch information
UiP9AV6Y authored Mar 13, 2024
2 parents 97a50b4 + 79bdfd2 commit 307999c
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 3 deletions.
6 changes: 6 additions & 0 deletions tools/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# buildinfo tools

The tools in this module are used to generate code for bootstrapping
applications for use with [buildinfo](https://github.com/UiP9AV6Y/buildinfo),
or to extract version information from the current environment for
embedding into the application build output.
2 changes: 1 addition & 1 deletion tools/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/UiP9AV6Y/buildinfo/tools
go 1.19

require (
github.com/UiP9AV6Y/buildinfo v0.0.0-20231118114407-a0fa77164a70
github.com/UiP9AV6Y/buildinfo v0.0.0-20240313195626-97a50b40242a
github.com/go-kit/log v0.2.1
gotest.tools/v3 v3.5.1
)
Expand Down
4 changes: 2 additions & 2 deletions tools/go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
github.com/UiP9AV6Y/buildinfo v0.0.0-20231118114407-a0fa77164a70 h1:FY43764yCaKPS6MGdKE6Co/9rdt4I8vXqgO+4ieEZOU=
github.com/UiP9AV6Y/buildinfo v0.0.0-20231118114407-a0fa77164a70/go.mod h1:xOw/nvP1ol539jLd1YV6oueyGt8h7RaQ0+r2PHDhidk=
github.com/UiP9AV6Y/buildinfo v0.0.0-20240313195626-97a50b40242a h1:a2IDIfV2Smoe+mwj553zsTglo67fsMPN05tjBRpT4J0=
github.com/UiP9AV6Y/buildinfo v0.0.0-20240313195626-97a50b40242a/go.mod h1:JQKMnAuoFntCA2Lrxfl46yZRuhPPUNsq4Z9Dh03uqPA=
github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU=
github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0=
github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA=
Expand Down
6 changes: 6 additions & 0 deletions tools/renderer/golang/embed.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ func Version() string {
func Print(program string) string {
return buildInfo.Print(program)
}
// BuildInfo creates an independent copy of the internal
// build information.
func BuildInfo() *buildinfo.BuildInfo {
return buildInfo.Clone()
}
`
)

Expand Down
6 changes: 6 additions & 0 deletions tools/renderer/golang/testdata/args.golden
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,9 @@ func Version() string {
func Print(program string) string {
return buildInfo.Print(program)
}

// BuildInfo creates an independent copy of the internal
// build information.
func BuildInfo() *buildinfo.BuildInfo {
return buildInfo.Clone()
}
6 changes: 6 additions & 0 deletions tools/renderer/golang/testdata/embed.golden
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,9 @@ func Version() string {
func Print(program string) string {
return buildInfo.Print(program)
}

// BuildInfo creates an independent copy of the internal
// build information.
func BuildInfo() *buildinfo.BuildInfo {
return buildInfo.Clone()
}
6 changes: 6 additions & 0 deletions tools/version/version.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 307999c

Please sign in to comment.