5 ms·
What are you missing when programming in Go?
by ngrilly 9y ago
What are you missing when programming in Go?
- majewsky 9y ago.map() .filter() Not having to write useless type casting boilerplate like this: https://github.com/majewsky/sqlproxy/blob/f5b297e7dce14c045323881f272b97a3fdfb74c3/driver.go#L260-L266 https://github.com/majewsky/sqlproxy/blob/f5b297e7dce14c0453... Not having to write `if err != nil { return nil, err }` every second line. (Or, in other words, Rust's question-mark operator.)
- randomdata 9y agoFor me, an implicit way to convert between similar, but not identical, types. A real-world open source example I am aware of having a similar issue is Upspin[1]. There are ways to mitigate this, but you (well, I) cannot always control all the types third-party dependencies rely on. There is a clear path to working around this case, but I find it to be a bit tedious. I miss languages where, through generics, duck-typing, or similar that I can simply pass the application's structure to the third-party library and it "just works". [1] https://github.com/upspin/upspin/blob/master/upspin/proto/proto.go https://github.com/upspin/upspin/blob/master/upspin/proto/pr...