3 ms·
That would be nice, but that is not true in Go. You can register with a function like this one: http://golang.org/pkg/database/sql/#Register http://golang.org/
by nulltype 11y ago
That would be nice, but that is not true in Go. You can register with a function like this one: http://golang.org/pkg/database/sql/#Register http://golang.org/pkg/database/sql/#Register (mentioned in the article) and run it in your init() function or any similar function that a client calls.
That will collide with any other package that also uses that registration function for the same value of 'name'.
- a13xb 11y agoRight, when you leak handles to package objects externally, all bets are off.