Skip to content

Commit a7e960d

Browse files
committed
dsn: add godoc
1 parent 4c45491 commit a7e960d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

dsn.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ var (
2828
errInvalidDSNUnsafeCollation = errors.New("invalid DSN: interpolateParams can not be used with unsafe collations")
2929
)
3030

31-
// Config is a configuration parsed from a DSN string
31+
// Config is a configuration parsed from a DSN string.
32+
// If a new Config is created instead of being parsed from a DSN string,
33+
// the NewConfig function should be used, which sets default values.
3234
type Config struct {
3335
User string // Username
3436
Passwd string // Password (requires User)
@@ -57,6 +59,7 @@ type Config struct {
5759
RejectReadOnly bool // Reject read-only connections
5860
}
5961

62+
// NewConfig creates a new Config and sets default values.
6063
func NewConfig() *Config {
6164
return &Config{
6265
Collation: defaultCollation,

0 commit comments

Comments
 (0)