From 320a5612c1dedb57eb41c9f92741c6c3026c4d2f Mon Sep 17 00:00:00 2001 From: gedi Date: Wed, 25 May 2016 14:26:56 +0300 Subject: [PATCH] bump version, update error handling on main command --- cmd/godog/main.go | 9 +++++---- gherkin.go | 1 + godog.go | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/cmd/godog/main.go b/cmd/godog/main.go index b776bee..d1ddc7f 100644 --- a/cmd/godog/main.go +++ b/cmd/godog/main.go @@ -41,9 +41,9 @@ func buildAndRun() (int, error) { cmdb := exec.Command("go", "test", "-c", "-o", bin) cmdb.Dir = dir cmdb.Env = os.Environ() - if dat, err := cmdb.CombinedOutput(); err != nil { - fmt.Println(string(dat)) - return 1, nil + if details, err := cmdb.CombinedOutput(); err != nil { + fmt.Println(string(details)) + return 1, err } defer os.Remove(bin) @@ -78,7 +78,8 @@ func buildAndRun() (int, error) { func main() { status, err := buildAndRun() if err != nil { - panic(err) + fmt.Println(err) + os.Exit(1) } // it might be a case, that status might not be resolved // in some OSes. this is attempt to parse it from stderr diff --git a/gherkin.go b/gherkin.go index 80c6b36..ec45f1b 100644 --- a/gherkin.go +++ b/gherkin.go @@ -4,6 +4,7 @@ import "gopkg.in/cucumber/gherkin-go.v3" // examples is a helper func to cast gherkin.Examples // or gherkin.BaseExamples if its empty +// @TODO: this should go away with gherkin update func examples(ex interface{}) (*gherkin.Examples, bool) { t, ok := ex.(*gherkin.Examples) return t, ok diff --git a/godog.go b/godog.go index 6c26e92..fcf96ed 100644 --- a/godog.go +++ b/godog.go @@ -44,4 +44,4 @@ Godog was inspired by Behat and the above description is taken from it's documen package godog // Version of package - based on Semantic Versioning 2.0.0 http://semver.org/ -const Version = "v0.2.0" +const Version = "v0.4.0"