feat(cli): add version diagnostics and build-aware start
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package version
|
||||
|
||||
import (
|
||||
"runtime"
|
||||
"testing"
|
||||
)
|
||||
|
||||
// Catches a source build that reports no usable identity or the wrong host platform.
|
||||
func TestCurrentReportsUsableSourceBuildIdentity(t *testing.T) {
|
||||
info := Current()
|
||||
if info.Version == "" || info.Commit == "" || info.BuildTime == "" {
|
||||
t.Fatalf("Current() = %#v, want non-empty build identity", info)
|
||||
}
|
||||
if info.OS != runtime.GOOS || info.Arch != runtime.GOARCH {
|
||||
t.Fatalf("Current() platform = %s/%s, want %s/%s", info.OS, info.Arch, runtime.GOOS, runtime.GOARCH)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user