Commit Graph

7 Commits

Author SHA1 Message Date
Kian-Meng Ang 0089167cae
Fix typos (#1413)
Found via `codespell -L ede,ans,te,crasher`
2023-01-14 08:19:09 +01:00
Shubhendra Singh Chauhan 2f14d104f3
improve code quality (#1228)
* Combine multiple `append`s into a single call

* Fix Yoda conditions

* Fix check for empty string

* revert "combine multiple `append`s"
2021-02-25 17:01:55 +01:00
Tom Limoncelli 7e7e8dcb22 util.TrimDomainName() fails when origin doesn't end in dot (#559)
* Fix https://github.com/miekg/dns/issues/555 dnsutil.TrimDomainName tests fail

* Remove comment

* Clean up comments and code.

* Clean up comments, use dns.Fqdn() where we can, lint.
2017-11-08 18:19:10 +00:00
Miek Gieben 388f6eea29
Tests updates (#556)
Use :0 for loopback testing. This is more portable between testing environments.
Add testRR that calls NewRR and throws error away - apply it everywhere where needed.

It seems only Go 1.9 can deal with :0 being used. Disable 1.8 in travis.
2017-11-08 10:01:19 +00:00
Miek Gieben 4bcc48899c
golint fixes (#553)
* golint fixes

Comment all RR with references to relevant RFC or other docs.
Some lint fixes in edns0.go.

* Some more fixes
2017-11-07 13:45:27 +00:00
Richard Gibson eccf8bbe83 Correctly parse omitted TTLs and relative domains (#513)
* Fix $TTL handling
* Error when there is no TTL for an RR
* Fix relative name handling
* Error when a relative name is used without an origin (cf. https://tools.ietf.org/html/rfc1035#section-5.1 )

Fixes #484
2017-09-26 11:15:37 -04:00
tal@whatexit.org 808f9308ef Added new functions: TrimDomainName()/AddOrigin()
* TrimDomainName() Trims the domain off a FQDN.
  * AddOrigin() Adds a domain to a shortname or leaves a FQDN alone.
2016-01-25 12:08:29 -05:00