database/sql: update SetMaxIdleConns documentation to specify the default value #22138
Labels
Documentation
FrozenDueToAge
NeedsFix
The path to resolution is known, but the work has not been done.
Milestone
Can the team please update the documentation for
SetMaxIdleConns
to specify what the default value should be.I fell into a trap in here: https://github.com/pjebs/go-skeleton/blob/master/config/database.go#L51
where the the struct I used will set
SetMaxIdleConns
to0
(which is the zero-value of an int).It turns out that intended default value is 2, but the documentation does not state that.
Also on a separate issue:
I don't think defaultMaxIdleConns const is actually used properly in the code. I suspect it is a bug.
The text was updated successfully, but these errors were encountered: