Comment

Comment by benstigsen

I noted this on my website, some time ago [1]:

> Making use of sql.DB from multiple goroutines is safe, since Go manages its own internal mutex.

Then I quote the database/sql documentation [2]:

> DB is a database handle representing a pool of zero or more underlying connections. It's safe for concurrent use by multiple goroutines.

[1]: https://stigsen.dev/notes/go-database-thread-safety/ [2]: https://pkg.go.dev/database/[email protected]#DB

parent benstigsen 1 year ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton