1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

get-zones output should work as input into preview (#688)

* Add tests for get-zones
* fix CAA, SSHFP, TLSA and other bugs
* New format for get-zones: "djs" which is js but uses "disco commas"
* Print diffs using github.com/andreyvit/diff

Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
This commit is contained in:
Tom Limoncelli
2020-03-10 11:32:47 -04:00
committed by GitHub
parent 67e78f7e15
commit 4edf360854
30 changed files with 4993 additions and 37 deletions

19
vendor/github.com/andreyvit/diff/trim.go generated vendored Normal file
View File

@@ -0,0 +1,19 @@
package diff
import (
"strings"
)
// TrimLines applies TrimSpace to each string in the given array.
func TrimLines(input []string) []string {
result := make([]string, 0, len(input))
for _, el := range input {
result = append(result, strings.TrimSpace(el))
}
return result
}
// TrimLinesInString applies TrimSpace to each line in the given string, and returns the new trimmed string. Empty lines are not removed.
func TrimLinesInString(input string) string {
return strings.Join(TrimLines(strings.Split(strings.TrimSpace(input), "\n")), "\n")
}