This is ideal error handling. You may not like it, but this is what peak readability looks like

This is ideal error handling. You may not like it, but this is what peak readability looks like.
Anyone laughing at Go shall be forever silent as Go 2.0 releases.

Attached: Screenshot_20181010-015751_Firefox.jpg (1920x1080, 390K)

>go becomes the first language to add generics as a feature since java in 2004
holy shit!

I just use if statements and abort ();
No error tolerated.
Dumping this core
WITH NO SURVIVORS!!

based, I use a similar approach when I do Java freelancing work, whenever I have to use a method with checked exceptions I just wrap it in this:

try {
// ...
} catch (Exception ignored) {
throw new RuntimeException("FATAL ERROR(1234)! please contact [email protected] for support.");
}

> "try catch" is bad, so we're introducing "catch try"... err, "handle check".

java added var
holy cow!

i saw this video in person at gophercon. embarrassing.

>it is literally a different syntax for try-catch
not superior Result
>returning a nil error on success
not the superior Option

Pattern matching is the future.
pub fn from_buf(buf: &str) -> Result { ... };

let request = HttpRequest::from_buf(&buf);
match request {
Ok(req) => match req.method {
HttpMethod::GET => {}
HttpMethod::POST => {}
HttpMethod::DELETE => {}
HttpMethod::UPDATE => {}
HttpMethod::HEAD => {}
HttpMethod::OPTION => {}
HttpMethod::CONNECT => {}
HttpMethod::TRACE => {}
},
Err(ref e) => {
/* Handle Error */
}
};

This desu. I was making a scala project and was on the verge of tossing exceptions anywhere, but either just feels way more natural after using Result types for so long.

>:=
>nil
pascal is comf af bro

/thread

so like exceptions, but less convenient. this is some galaxy brain shit lmao

try -> Ok
catch -> Err
incredible!

I started writing a technical response to your bullshit but after a minute I realize you're too retarded to argue with in the first place

>I started writing a technical response to your bullshit but after a minute I realized I couldn't
fixed, brainlet

This is just syntactic sugar for return. There's no expensive unwinding of the call stack and checking for exception handlers.

So will the files be automatically closed by that error handling? Is that just implicit?

Yes, that's how defer works in the current error handling too

Monads are the only good way to handle errors
don't @ me

>error is just a string

Attached: 1532444043576.jpg (399x400, 47K)

this is fantastic

I agree though. Everyone is always saying how we need to find a better way to handle errors but are too ignorant to realise that monads are the best and most ergonomic way.

No its not. It is an interface. Some errors have times and such

>Literally just a worse version of Rust's ? operator
>Is based on product types rather than sum types
Lmao Go is for retards by retarda

Is that fake info because I'd hate to go back and work on my years old intentional spaghetti code.

that looks actually less retarded than go 1.x

it's real and I would hate it too if I didn't charge them extortionate rates, once the code is used in production they have no choice but to pay up or they lose even more money