My code has many checks to detect errors in various cases (many conditions would result in the same error), inside a function returning an error struct. Instead of looking like this:err_struct myfunc(...) {    err_struct error = { .error = false };    ...    if(something) {        error.error = true;        error.description = invalid input;        return error;    }    ...        case 1024:            error.error = true;            error.description = invalid input;  // same error, but different detection scenario            return error;            break;  // don't comment on this break please (EDIT: pun unintended)            ...Is use of goto in the following context considered better than the previous example?err_struct myfunc(...) {    err_struct error = { .error = false };    ...    if(something) goto invalid_input;    ...        case 1024:            goto invalid_input;            break;    return error;    invalid_input:        error.error = true;        error.description = invalid input;        return error;
Is goto to improve DRY-ness OK?
c;error handling;dry;goto
if using goto your code reads better, use it. It is a language feature like every other. We are anymore at the age of Dijkstra.http://david.tribble.com/text/goto.htmlint parse(){    Token   tok;reading:    tok = gettoken();    if (tok == END)        return ACCEPT;shifting:    if (shift(tok))        goto reading;reducing:    if (reduce(tok))        goto shifting;    return ERROR;}This is a case where goto-s are even more elegant than whatever other structure.