[go-nuts] Re: How to distribute database connection across all golang file ?

2022-01-08 Thread Amit Saha
The usual pattern is to have a global *sql.Db object obtained via calling the Open() function as explained at [1]. You don't have to worry about maintaining the connection pool yourselves as that's automatically done. The Go tutorial on the topic [2] shows you can do this using a global variabl

[go-nuts] How to distribute database connection across all golang file ?

2022-01-08 Thread Shishira Pradhan
Hello All, What is the appropriate and industry standard mechanism to send database connection across golang file to use in logic layer to get data from DB? It should be one time connection established and many time use the connection pool across all files. Thanks, Shishira -- You received t

Re: [go-nuts] Re: An mistake in tip spec?

2022-01-08 Thread Brian Candler
Now my head is spinning: interface{ int; m() } // int (but type set is empty because int has no method m) interface{ ~int; m() } // int (but type set is infinite because there are many int types with method m) On Saturday, 8 January 2022 at 02:32:35 UTC gri wrote: > Indeed. Th