mirror of
https://github.com/syncthing/syncthing.git
synced 2024-11-16 10:28:49 -07:00
Fix some config Copy() things we had forgotten
This commit is contained in:
parent
724c1e297f
commit
679f0f9363
@ -47,6 +47,7 @@ func (f FolderConfiguration) Copy() FolderConfiguration {
|
||||
c := f
|
||||
c.Devices = make([]FolderDeviceConfiguration, len(f.Devices))
|
||||
copy(c.Devices, f.Devices)
|
||||
c.Versioning = f.Versioning.Copy()
|
||||
return c
|
||||
}
|
||||
|
||||
|
@ -49,5 +49,9 @@ func (orig OptionsConfiguration) Copy() OptionsConfiguration {
|
||||
copy(c.ListenAddress, orig.ListenAddress)
|
||||
c.GlobalAnnServers = make([]string, len(orig.GlobalAnnServers))
|
||||
copy(c.GlobalAnnServers, orig.GlobalAnnServers)
|
||||
c.RelayServers = make([]string, len(orig.RelayServers))
|
||||
copy(c.RelayServers, orig.RelayServers)
|
||||
c.AlwaysLocalNets = make([]string, len(orig.AlwaysLocalNets))
|
||||
copy(c.AlwaysLocalNets, orig.AlwaysLocalNets)
|
||||
return c
|
||||
}
|
||||
|
@ -23,6 +23,15 @@ type InternalParam struct {
|
||||
Val string `xml:"val,attr"`
|
||||
}
|
||||
|
||||
func (c VersioningConfiguration) Copy() VersioningConfiguration {
|
||||
cp := c
|
||||
cp.Params = make(map[string]string, len(c.Params))
|
||||
for k, v := range c.Params {
|
||||
cp.Params[k] = v
|
||||
}
|
||||
return cp
|
||||
}
|
||||
|
||||
func (c *VersioningConfiguration) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
|
||||
var tmp InternalVersioningConfiguration
|
||||
tmp.Type = c.Type
|
||||
|
Loading…
Reference in New Issue
Block a user