bump version, update error handling on main command

Этот коммит содержится в:
gedi 2016-05-25 14:26:56 +03:00
родитель 70af4fc5a7
коммит 320a5612c1
3 изменённых файлов: 7 добавлений и 5 удалений

Просмотреть файл

@ -41,9 +41,9 @@ func buildAndRun() (int, error) {
cmdb := exec.Command("go", "test", "-c", "-o", bin) cmdb := exec.Command("go", "test", "-c", "-o", bin)
cmdb.Dir = dir cmdb.Dir = dir
cmdb.Env = os.Environ() cmdb.Env = os.Environ()
if dat, err := cmdb.CombinedOutput(); err != nil { if details, err := cmdb.CombinedOutput(); err != nil {
fmt.Println(string(dat)) fmt.Println(string(details))
return 1, nil return 1, err
} }
defer os.Remove(bin) defer os.Remove(bin)
@ -78,7 +78,8 @@ func buildAndRun() (int, error) {
func main() { func main() {
status, err := buildAndRun() status, err := buildAndRun()
if err != nil { if err != nil {
panic(err) fmt.Println(err)
os.Exit(1)
} }
// it might be a case, that status might not be resolved // it might be a case, that status might not be resolved
// in some OSes. this is attempt to parse it from stderr // in some OSes. this is attempt to parse it from stderr

Просмотреть файл

@ -4,6 +4,7 @@ import "gopkg.in/cucumber/gherkin-go.v3"
// examples is a helper func to cast gherkin.Examples // examples is a helper func to cast gherkin.Examples
// or gherkin.BaseExamples if its empty // or gherkin.BaseExamples if its empty
// @TODO: this should go away with gherkin update
func examples(ex interface{}) (*gherkin.Examples, bool) { func examples(ex interface{}) (*gherkin.Examples, bool) {
t, ok := ex.(*gherkin.Examples) t, ok := ex.(*gherkin.Examples)
return t, ok return t, ok

Просмотреть файл

@ -44,4 +44,4 @@ Godog was inspired by Behat and the above description is taken from it's documen
package godog package godog
// Version of package - based on Semantic Versioning 2.0.0 http://semver.org/ // Version of package - based on Semantic Versioning 2.0.0 http://semver.org/
const Version = "v0.2.0" const Version = "v0.4.0"