From 8e578cb45e084fc071c4bd2ec979ae310f60ef7d Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 28 May 2020 10:20:45 +0200 Subject: [PATCH] Check for windows test executable when checking version information --- info/version.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/info/version.go b/info/version.go index c7ed4b8..a1790ee 100644 --- a/info/version.go +++ b/info/version.go @@ -85,7 +85,13 @@ func FullVersion() string { // CheckVersion checks if the metadata is ok. func CheckVersion() error { - if !strings.HasSuffix(os.Args[0], ".test") { + switch { + case strings.HasSuffix(os.Args[0], ".test"): + return nil // testing on linux/darwin + case strings.HasSuffix(os.Args[0], ".test.exe"): + return nil // testing on windows + default: + // check version information if name == "[NAME]" { return errors.New("must call SetInfo() before calling CheckVersion()") } @@ -100,5 +106,6 @@ func CheckVersion() error { return errors.New("please build using the supplied build script.\n$ ./build {main.go|...}") } } + return nil }