From b0474155fb906564ddfe9351802afcd3524b3f46 Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Mon, 21 Apr 2014 09:10:39 +0100 Subject: [PATCH] NewRR: add documentation about Rdlength Rdlength is not set when the RR is returned from NewRR and friends. --- zscan.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/zscan.go b/zscan.go index 53ea3269..55d30f46 100644 --- a/zscan.go +++ b/zscan.go @@ -108,6 +108,7 @@ type Token struct { // NewRR reads the RR contained in the string s. Only the first RR is returned. // The class defaults to IN and TTL defaults to 3600. The full zone file // syntax like $TTL, $ORIGIN, etc. is supported. +// All fields of the returned RR are set, except RR.Header().Rdlength wich is 0. func NewRR(s string) (RR, error) { if s[len(s)-1] != '\n' { // We need a closing newline return ReadRR(strings.NewReader(s+"\n"), "") @@ -115,8 +116,8 @@ func NewRR(s string) (RR, error) { return ReadRR(strings.NewReader(s), "") } -// ReadRR reads the RR contained in q. Only the first RR is returned. -// The class defaults to IN and TTL defaults to 3600. +// ReadRR reads the RR contained in q. +// See NewRR for more documentation. func ReadRR(q io.Reader, filename string) (RR, error) { r := <-parseZoneHelper(q, ".", filename, 1) if r.Error != nil {