Short answer: no.
You don't need to explicitly synchronise your code, because calls to any method on db
that require a lock will simply block until the lock is released. In other words, synchronisation is taken care of by the package that actually needs the synchronisation.
As a side note, I would suggest to run your code through gofmt
, which will make other Go nuts who read your code happy.