diff --git a/example_test.go b/example_test.go index 8e5ae50b..28315e27 100644 --- a/example_test.go +++ b/example_test.go @@ -102,7 +102,7 @@ func (rd *APAIR) Unpack(buf []byte) (int, error) { return len(buf), nil } -func (rd *APAIR) CopyRdata(dest dns.PrivateRdata) error { +func (rd *APAIR) Copy(dest dns.PrivateRdata) error { cp := make([]byte, rd.Len()) _, err := rd.Pack(cp) if err != nil { diff --git a/privaterr.go b/privaterr.go index c3392967..85e70582 100644 --- a/privaterr.go +++ b/privaterr.go @@ -25,8 +25,8 @@ type PrivateRdata interface { // Unpack is used when unpacking a private RR from a buffer. // TODO(miek): diff. signature than Pack, see edns0.go for instance. Unpack([]byte) (int, error) - // CopyRdata copies the Rdata. - CopyRdata(PrivateRdata) error + // Copy copies the Rdata. + Copy(PrivateRdata) error // Len returns the length in octets of the Rdata. Len() int } @@ -64,7 +64,7 @@ func (r *PrivateRR) copy() RR { newh := r.Hdr.copyHeader() rr.Hdr = *newh - err := r.Data.CopyRdata(rr.Data) + err := r.Data.Copy(rr.Data) if err != nil { panic("dns: got value that could not be used to copy Private rdata") } diff --git a/privaterr_test.go b/privaterr_test.go index be236a2a..82521571 100644 --- a/privaterr_test.go +++ b/privaterr_test.go @@ -37,7 +37,7 @@ func (rd *ISBN) Unpack(buf []byte) (int, error) { return len(buf), nil } -func (rd *ISBN) CopyRdata(dest dns.PrivateRdata) error { +func (rd *ISBN) Copy(dest dns.PrivateRdata) error { isbn, ok := dest.(*ISBN) if !ok { return dns.ErrRdata @@ -127,7 +127,7 @@ func (rd *VERSION) Unpack(buf []byte) (int, error) { return len(buf), nil } -func (rd *VERSION) CopyRdata(dest dns.PrivateRdata) error { +func (rd *VERSION) Copy(dest dns.PrivateRdata) error { isbn, ok := dest.(*VERSION) if !ok { return dns.ErrRdata