{"action":"created","issue":{"url":"https://api.github.com/repos/go-godo/godo/issues/23","labels_url":"https://api.github.com/repos/go-godo/godo/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/go-godo/godo/issues/23/comments","events_url":"https://api.github.com/repos/go-godo/godo/issues/23/events","html_url":"https://github.com/go-godo/godo/issues/23","id":58449507,"number":23,"title":"Handle exit codes / build errors","user":{"login":"ciarand","id":2149341,"avatar_url":"https://avatars.githubusercontent.com/u/2149341?v=3","gravatar_id":"","url":"https://api.github.com/users/ciarand","html_url":"https://github.com/ciarand","followers_url":"https://api.github.com/users/ciarand/followers","following_url":"https://api.github.com/users/ciarand/following{/other_user}","gists_url":"https://api.github.com/users/ciarand/gists{/gist_id}","starred_url":"https://api.github.com/users/ciarand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ciarand/subscriptions","organizations_url":"https://api.github.com/users/ciarand/orgs","repos_url":"https://api.github.com/users/ciarand/repos","events_url":"https://api.github.com/users/ciarand/events{/privacy}","received_events_url":"https://api.github.com/users/ciarand/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-21T08:12:46Z","updated_at":"2015-04-29T22:40:13Z","closed_at":"2015-02-21T13:44:03Z","body":"If [this](https://github.com/go-godo/godo/blob/master/tasks/Godofile.go#L38-L40) test function (reproduced below) fails at any point `godo` continues to return an exit code of 0, which is unhelpful for use in e.g. git hooks.\r\n\r\n```go\r\n\tp.Task(\"test\", func() {\r\n\t\tRun(\"go test\")\r\n\t})\r\n```\r\n\r\nCan we add an acceptable error returning func type?\r\n\r\n```go\r\n\tp.Task(\"test\", func() error {\r\n\t\treturn Run(\"go test\")\r\n\t})\r\n```\r\n\r\nThe expected result would be that if a function returned an error, the process would exit.\r\n\r\nCalling `os.Exit` should be done at the outermost layer as much as possible because any `defer`'d functions are not guaranteed to be called if an `os.Exit` happens deeper in the call stack.\r\n\r\nUPDATED: a previous version of this issue talked about the lint task (gofmt, go vet, golint) but the test one is simpler"},"comment":{"url":"https://api.github.com/repos/go-godo/godo/issues/comments/97607502","html_url":"https://github.com/go-godo/godo/issues/23#issuecomment-97607502","issue_url":"https://api.github.com/repos/go-godo/godo/issues/23","id":97607502,"user":{"login":"ansel1","id":107825,"avatar_url":"https://avatars.githubusercontent.com/u/107825?v=3","gravatar_id":"","url":"https://api.github.com/users/ansel1","html_url":"https://github.com/ansel1","followers_url":"https://api.github.com/users/ansel1/followers","following_url":"https://api.github.com/users/ansel1/following{/other_user}","gists_url":"https://api.github.com/users/ansel1/gists{/gist_id}","starred_url":"https://api.github.com/users/ansel1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ansel1/subscriptions","organizations_url":"https://api.github.com/users/ansel1/orgs","repos_url":"https://api.github.com/users/ansel1/repos","events_url":"https://api.github.com/users/ansel1/events{/privacy}","received_events_url":"https://api.github.com/users/ansel1/received_events","type":"User","site_admin":false},"created_at":"2015-04-29T22:40:13Z","updated_at":"2015-04-29T22:40:13Z","body":"the good command doesn't exit with the same code though.  Running the above sample with `godo test` would still result in a 0 exit code."}}