Add quoteString function.

This is to just quote a string s -> "s"
This commit is contained in:
Miek Gieben 2014-01-11 16:57:36 +00:00
parent 3bd18e9a56
commit a49cd38336
2 changed files with 6 additions and 2 deletions

View File

@ -834,8 +834,8 @@ func TestTxtEqual(t *testing.T) {
rr1.Txt = []string{"a\"a", "\"", "b"}
rr2, _ := NewRR(rr1.String())
if rr1.String() != rr2.String() {
// t.Fail() // Is this a bug?
t.Logf("Two TXT records should match")
t.Fail()
t.Logf("These two TXT records should match")
t.Logf("\n%s\n%s\n", rr1.String(), rr2.String())
}
}

View File

@ -1502,6 +1502,10 @@ func euiToString(eui uint64, bits int) (hex string) {
return
}
func quoteString(s string) string {
return "\"" + s + "\""
}
// Map of constructors for each RR wire type.
var rr_mk = map[uint16]func() RR{
TypeA: func() RR { return new(A) },