FAQ
Hello everyone,
I had an idea to add different exit codes to the go tool that would allow
programs that use it figure out what exactly went wrong. Right now I
believe exit code is always 1 if something went wrong.
But I want to know others' opinions on this, perhaps there's some reason
not to do so.
For example go build status codes would be something like:
0 - success
1 - package not found in GOPATH
2 - compilation failed
3 - permission denied opening source files/writing output file
etc.
There would be one single list for all tools, grouped up by type (e.g. 1-10
build-related errors, 10-20 go get related, etc.).

Original problem: I'm writing some very basic CI server, for no good
reason, and it's not very straightforward to figure out exact cause why
e.g. go get -u failed based on output and exit code.

If there are no reasons against this and if nobody had this planned
already, I'd like to give it a try and make a patch.

--

---
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Russ Cox at Mar 31, 2014 at 4:27 pm
    In general Go avoids shoehorning errors into tiny integers. That's why we
    have the error interface type instead of C's errno. I would prefer to
    arrange that the output is useful.

    Russ

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Andrew Lytvynov at Mar 31, 2014 at 4:39 pm
    Good point. Perhaps then a standard error message structure (that is also
    easily parsable) for all tools, prepended to a full error that we get right
    now would make sense?
    Although that could also trash the output if it's too bulky.

    On Mon, Mar 31, 2014 at 7:27 PM, Russ Cox wrote:

    In general Go avoids shoehorning errors into tiny integers. That's why we
    have the error interface type instead of C's errno. I would prefer to
    arrange that the output is useful.

    Russ
    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-dev @
categoriesgo
postedMar 31, '14 at 3:56p
activeMar 31, '14 at 4:39p
posts3
users2
websitegolang.org

2 users in discussion

Andrew Lytvynov: 2 posts Russ Cox: 1 post

People

Translate

site design / logo © 2021 Grokbase