Has anyone ever tallied the number of different forum threads related to 
changing Go error handling ?  
The current method is obviously a vexing issue to many Go users, and
It seems silly that this issue has never been resolved by the Go team 
beyond maintaining the status quo... despite, IMHO, several good 
alternatives that have been suggested on this very forum.


On Friday, July 31, 2020 at 10:06:33 AM UTC-4, semi...@gmail.com wrote:
>
> Hey Community,
>
> I know, there are so many discussion about error handling. I read tons of 
> idea about that. Looks like most of idea rejected from community but every 
> idea brings our goal closer.
>
> May be we need simple solution. I like Go's simplest ways always. I don't 
> think so we need complex solution about that. Could we handle complexity 
> the error checking with simple throws statement?
>
>
> func myFileRDWRFunc(filename string) (string, error) {
>    f, err := os.OpenFile(filename, os.O_RDWR, 0600)
>    if err != nil { // backward compatibility
>        return "", err
>    }
>
>     throws func(err error) { // catch all errors
>        log.Println(err)
>        f.Close()
>
>         return "", err
>    }()
>
>     f.WriteString("anystring")
>    f.Seek(0, 0)
>     b := ioutil.ReadAll(f)
>
>     return string(b), nil
> }
>
> Cheers.
>
> Semih.
>
>

-- 
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/e59eae6e-21c2-4f61-a222-48f6a43dbd74o%40googlegroups.com.

Reply via email to