Copy returns a deep copy of a RecordConfig.
()
| 254 | |
| 255 | // Copy returns a deep copy of a RecordConfig. |
| 256 | func (rc *RecordConfig) Copy() (*RecordConfig, error) { |
| 257 | newR := &RecordConfig{} |
| 258 | // Copy the exported fields. |
| 259 | err := reprint.FromTo(rc, newR) // Deep copy |
| 260 | // Set each unexported field. |
| 261 | newR.target = rc.target |
| 262 | return newR, err |
| 263 | } |
| 264 | |
| 265 | // SetLabel sets the .Name/.NameFQDN fields given a short name and origin. |
| 266 | // origin must not have a trailing dot: The entire code base maintains dc.Name |
no outgoing calls