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"} }