[sorry, posted a half post before]
You would want to have the error value at hand and do everything explicitly.
Using the try keyword really feels like going back to some other languages 
where you would push everything up and then handle
a bunch of errors/exceptions in a "all eggs in one basket" fashion. It's a 
strength of go to have such granular value and interface semantics
available for dealing with any kind of values.



reede, 7. veebruar 2020 5:28.24 UTC+2 kirjutas addi...@gmail.com:
>
>
> Example using it with try
>
> f, err := os.Open("file.dat")
> try errors.Wrap(err, "couldn't open file")
> defer f.Close()
>
> f.WriteString("...")
>
> That’s it.
>
> This should reduce repetitiveness with error handling in most cases.
>
> It is very simple to understand, and it feels like Go.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/69f5d1db-1197-4647-8131-28369f6b32e8%40googlegroups.com.

Reply via email to