dnscontrol/pkg/recordaudit/ultimate.go
Tom Limoncelli 8dea9edc34
Re-engineer TXT records for simplicity and better compliance (#1063)
TXT records are now handled different.

1. The raw input from dnsconfig.js is passed all the way to the provider. The provider can determine if it can or can't handle such records (auditrecords.go) and processes them internally as such.
2. The CanUseTXTMulti capability is no longer needed.

* DSPs now register a table of functions
* Use audits for txt record variations
* unit tests pass. integration fails.
* fix deepcopy problem
* rename to AuditRecordSupport
* Reduce use of TXTMulti
* Remove CanUseTXTMulti
* fix Test Skip
* fix DO
* fix vultr
* fix NDC
* msdns fixes
* Fix powerdns and cloudflare
* HEDNS: Fix usage of target field to resolve TXT handling (#1067)
* Fix HEXONET

Co-authored-by: Robert Blenkinsopp <robert@blenkinsopp.net>
Co-authored-by: Jakob Ackermann <das7pad@outlook.com>
2021-03-07 13:19:22 -05:00

21 lines
636 B
Go

package recordaudit
/*
I proposed that Go add something like "len()" that returns the highest
index. This would avoid off-by-one errors. The proposed names include
ultimate(), ult(), high(), highest().
Nay-sayers said I should implement this as a function and see if I
actually used it. (I suspect the nay-sayers are perfect people that
never make off-by-one errors.)
That's what this file is about. It should be exactly the same (except
the first line) anywhere this is needed. After a few years I'll be
able to report if it actually helped.
Go will in-line this function.
*/
func ultimate(s string) int {
return len(s) - 1
}