Skip to content

Commit ddc2ac9

Browse files
committed
Also need to clone the Multi field
1 parent e74de32 commit ddc2ac9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

connector.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,7 @@ type Config struct {
447447
// awkward to use.
448448
set []string `env:"set"`
449449

450+
// Only used in newConfig() and tests; joined in the Multi field at the end.
450451
multiHost []string
451452
multiHostaddr []netip.Addr
452453
multiPort []uint16
@@ -516,8 +517,7 @@ func NewConfig(dsn string) (Config, error) {
516517
// Clone returns a copy of the [Config].
517518
func (cfg Config) Clone() Config {
518519
c := cfg
519-
c.Runtime = maps.Clone(cfg.Runtime)
520-
c.set = slices.Clone(cfg.set)
520+
c.Runtime, c.Multi, c.set = maps.Clone(cfg.Runtime), slices.Clone(cfg.Multi), slices.Clone(cfg.set)
521521
return c
522522
}
523523

0 commit comments

Comments
 (0)