4 ms·
> Go’s type system/compiler doesn't lend you much in the way of helping ensure code correctness Do you have any examples? Not a golang programmer myself.
by tored 5y ago
> Go’s type system/compiler doesn't lend you much in the way of helping ensure code correctness
Do you have any examples? Not a golang programmer myself.
- eternalban 5y agoGo's weak type system encourages use of dynamic type ops (such as casting interface{}, etc) and obviously the compiler is out of the loop at compile time so it can't help.
- theshrike79 5y agoI've written my fair share of Go over the years and I've cast to interface{} exactly zero times.
- simiones 5y agoExplicitly, I believe you, but I'd bet you've often implicitly cast to interface{} (even some very legitimate cases like json.Marshal() are still technically casts to interface{}).