Add generic Copy function that copies RRs

Don't export all the copy() functions, instead add a Copy() function
that use the RR interface
This commit is contained in:
Miek Gieben 2014-01-27 14:25:24 +00:00
parent 0364de3abf
commit bb2ef9e3fc
1 changed files with 6 additions and 0 deletions

6
msg.go
View File

@ -1593,6 +1593,12 @@ func (dns *Msg) Copy() *Msg {
return r1
}
// Copy returns a new RR which is a deep-copy of r.
func Copy(r RR) RR {
r1 := r.copy()
return r1
}
// Put the parts of the name in the compression map.
func compressionLenHelper(c map[string]int, s string) {
pref := ""