5 ms·
Before commenting, please read the detailed design document [1] and see the discussion summary as of June 6 [2], the summary as of June 10 [3], and specifically
by guessmyname 7y ago
Before commenting, please read the detailed design document [1] and see the discussion summary as of June 6 [2], the summary as of June 10 [3], and specifically the advice on staying focussed [4]. Your question or suggestion may have already been answered or made. Thanks — ATT: Robert Griesemer
---
I like writing “if err != nil { … }” so while I disagree with the proposal to add the error check function “try()” I will keep an open mind because I do not have the technical literacy as @griesemer or other people in the Go community to propose something better. I’ll experiment with “try” a few times in personal projects, but I can see myself writing “if err != nil” for several years unless I find a more compelling reason to change, same reason why my team and I haven’t adopted “go mod” despite having Go v1.12.6 (latest stable version as of today) in all our production servers.
[1] https://github.com/golang/proposal/blob/master/design/32437-try-builtin.md https://github.com/golang/proposal/blob/master/design/32437-...
[2] https://github.com/golang/go/issues/32437#issuecomment-499261947 https://github.com/golang/go/issues/32437#issuecomment-49926...
[3] https://github.com/golang/go/issues/32437#issuecomment-500613160 https://github.com/golang/go/issues/32437#issuecomment-50061...
[4] https://github.com/golang/go/issues/32437#issuecomment-501878888 https://github.com/golang/go/issues/32437#issuecomment-50187...
- someone7x 7y ago> I like writing “if err != nil { … }” That idiom was my biggest turn off in learning Go. I would be 100x happier with "if not err {...}"