We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4c45491 commit a7e960dCopy full SHA for a7e960d
dsn.go
@@ -28,7 +28,9 @@ var (
28
errInvalidDSNUnsafeCollation = errors.New("invalid DSN: interpolateParams can not be used with unsafe collations")
29
)
30
31
-// Config is a configuration parsed from a DSN string
+// 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.
34
type Config struct {
35
User string // Username
36
Passwd string // Password (requires User)
@@ -57,6 +59,7 @@ type Config struct {
57
59
RejectReadOnly bool // Reject read-only connections
58
60
}
61
62
+// NewConfig creates a new Config and sets default values.
63
func NewConfig() *Config {
64
return &Config{
65
Collation: defaultCollation,
0 commit comments