mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
net: document LookupTXT behavior with multiple strings per record
Commit bfb077e0ee ("net: allow a dns TXT record to contain more than
one <character-string>") concatenates strings in a TXT record.
Document that behavior, since it's not obvious whether the strings
will be concatenated or accumulated in the returned slice.
This commit is contained in:
parent
704401ffa0
commit
ec0726c7b8
1 changed files with 6 additions and 0 deletions
|
|
@ -629,6 +629,9 @@ func (r *Resolver) LookupNS(ctx context.Context, name string) ([]*NS, error) {
|
||||||
|
|
||||||
// LookupTXT returns the DNS TXT records for the given domain name.
|
// LookupTXT returns the DNS TXT records for the given domain name.
|
||||||
//
|
//
|
||||||
|
// If a DNS TXT record holds multiple strings, they are concatenated as a
|
||||||
|
// single string.
|
||||||
|
//
|
||||||
// LookupTXT uses [context.Background] internally; to specify the context, use
|
// LookupTXT uses [context.Background] internally; to specify the context, use
|
||||||
// [Resolver.LookupTXT].
|
// [Resolver.LookupTXT].
|
||||||
func LookupTXT(name string) ([]string, error) {
|
func LookupTXT(name string) ([]string, error) {
|
||||||
|
|
@ -636,6 +639,9 @@ func LookupTXT(name string) ([]string, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// LookupTXT returns the DNS TXT records for the given domain name.
|
// LookupTXT returns the DNS TXT records for the given domain name.
|
||||||
|
//
|
||||||
|
// If a DNS TXT record holds multiple strings, they are concatenated as a
|
||||||
|
// single string.
|
||||||
func (r *Resolver) LookupTXT(ctx context.Context, name string) ([]string, error) {
|
func (r *Resolver) LookupTXT(ctx context.Context, name string) ([]string, error) {
|
||||||
return r.lookupTXT(ctx, name)
|
return r.lookupTXT(ctx, name)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue