NewRR: add documentation about Rdlength
Rdlength is not set when the RR is returned from NewRR and friends.
This commit is contained in:
parent
5592ee4172
commit
b0474155fb
5
zscan.go
5
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 {
|
||||
|
|
Loading…
Reference in New Issue