Re:Declined Proposal: A built-in Go error check function, “try”
by justinclift on Tuesday July 16, 2019 @09:15PM
(#20455541)
Packages extensively using reflect + interfaces together can be a bit of a pain to work through. :/
[ Parent
| on HN ]
Re:Declined Proposal: A built-in Go error check function, “try”
by sagichmal on Tuesday July 16, 2019 @09:58PM
(#20455754)
Absolutely. But those are clear code smells. Any org with competent code review would flag them and kill them before they proliferated.
Re:Declined Proposal: A built-in Go error check function, “try”
by jeremyjh on Tuesday July 16, 2019 @11:20PM
(#20456125)
Would you consider k8s to be developed by a competent org? They have 2324 func declarations that take or return an interface{} on master right now.
Re:Declined Proposal: A built-in Go error check function, “try”
by sagichmal on Wednesday July 17, 2019 @12:07AM
(#20456357)
Kubernetes, like Docker, is notoriously bad Go. The authors essentially transliterated Java.
Re:Declined Proposal: A built-in Go error check function, “try”
by inlined on Thursday July 18, 2019 @12:11AM
(#20466619)
This. It was really hard to enforce supplementary style across my team to match common conservatism in popular codebases (e.g. only return a single value or a value and bool/error. Don’t expose channels in APIs) when K8s so blatantly fails them.
Re:Declined Proposal: A built-in Go error check function, “try”
by justinclift on Wednesday July 17, 2019 @09:26PM
(#20465798)
Have you seen the internals of the Go http library? :)
Re:Declined Proposal: A built-in Go error check function, “try”
by inlined on Thursday July 18, 2019 @12:08AM
(#20466602)
Have you seen the internals of the rand library? HTTP uses interfaces cleverly to detect optional interfaces. Today I found out that rand.Rand does a type check on every core method to see if it’s source is the hidden type for global methods.