MongoDB CRUD operations for various types of data in Go
I am also starting out in go (although I used GAE's Datastore), and have spent some time thinking about this. I considered 3 options:
1 Code Generation
I think code generation would be a solid way to approach this solution. There's even a library starting out called streetCURD for PostgreSQL.
Code generation seems like a common way to do things in go. There is also a golang code generation tool called gen.
2 Don't Generalize
Depending on how many times you will copy and paste this, it may not be worth for you to generalize it. However, I find that after a few structs I start doubting this route... and others are not generalizing too: Example1. example2.
3 Interfaces
I ended up using interface{} for somethings (like error checking) which you stated you are not interested in. I felt it made the code more readable, which is my goal.
Looking over your code, it seems like you are interested in a method that return a user or a company- depending in the input, interface{} would be the way to go... (pun not intended).
Since I am just starting out, I'd love to see better responses to this question.