Note; I don't want to send any proposal currently. Firstly, I would like to
share and discuss my idea with community.
On Friday, 31 July 2020 at 17:06:33 UTC+3 Yasar Semih Alev 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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/golang-nuts/fd9308fa-9369-42bf-9fec-7b6691728f24n%40googlegroups.com.