From 9641a1be59e61977dd1c7d47d92e2e3412fda318 Mon Sep 17 00:00:00 2001 From: Jakub Zych Date: Wed, 21 Oct 2026 19:14:55 +0200 Subject: [PATCH] refactor(bonfire): read build info through a package variable BuildVersion calls readBuildInfo (debug.ReadBuildInfo) so tests can pin the tagged, replaced and go.work cases. No behaviour change. --- modules/bonfire/version.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/bonfire/version.go b/modules/bonfire/version.go index ddae0cc8..a6d3c3a5 100644 --- a/modules/bonfire/version.go +++ b/modules/bonfire/version.go @@ -7,6 +7,9 @@ import ( // frameworkModule is the module path of the SummerCMS framework. const frameworkModule = "git.golem15.com/golem15/summercms" +// readBuildInfo reads the binary's build information; tests replace it. +var readBuildInfo = debug.ReadBuildInfo + // Version is the version line of a binary: the application's own version and // the framework version it was built against. type Version struct { @@ -26,7 +29,7 @@ type Version struct { // the version of the git.golem15.com/golem15/summercms dependency, or App // when the main module is the framework itself. "(devel)" reads as "devel". func BuildVersion() Version { - info, ok := debug.ReadBuildInfo() + info, ok := readBuildInfo() if !ok { return Version{App: "devel", Framework: "devel"} }