← Home ← Back to /g/

Thread 105956953

8 posts 2 images /g/
Anonymous No.105956953 >>105957097 >>105959611 >>105959654 >>105959769
if err != nil {
return fmt.Errorf("oopsie wopsie: %w", err);
}


do Go-tards really?
Anonymous No.105957097
>>105956953 (OP)
That looks clean tho?
Anonymous No.105957142
it's a tragedy that autism is incurable.
Anonymous No.105959611
>>105956953 (OP)
gojeets are another breed of subhuman niggers
Anonymous No.105959654 >>105959719
>>105956953 (OP)
> guy who’s never seen C code and never debugged anything
Some people use Must() to strip out the error, or write a Check() to check it instead of the if.
I’ve returned an invalid unicode word as an “out-of-band” error before on string results.
Anonymous No.105959719
>>105959654
I have written my own Must. How does Check work?
My must is written like this:
func Must[T any](t T, err error) T {
if err != nil {
panic(err)
}
return t
}

how do you write check?
Anonymous No.105959769
>>105956953 (OP)
handling errors is le bad
Anonymous No.105960292
It forces you to handle errors like a normal person instead of enshittifying the codebase with your jeet code. Sounds good if you ask me.