News for hackers. Stuff that matters.
Re:Half a million lines of Go by eternalban on Monday May 17, 2021 @06:51AM (#27182069)
Go'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.
Re:Half a million lines of Go by theshrike79 on Monday May 17, 2021 @07:01AM (#27182122)
I've written my fair share of Go over the years and I've cast to interface{} exactly zero times.
Re:Half a million lines of Go by simiones on Monday May 17, 2021 @07:49AM (#27182412)
Explicitly, 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{}).