Change test structure into tabledriven

Review change
Update README.md
This commit is contained in:
cemturker
2020-11-18 18:51:22 +01:00
parent 4ad5c7b99c
commit 7f21fdee68
5 changed files with 102 additions and 47 deletions

View File

@ -20,10 +20,10 @@ const (
// Values that could replace the placeholder: 127.0.0.1, 10.0.0.1, ...
IPPlaceHolder = "[IP]"
// DNSRCode is a place holder for DNS_RCODE
// DNSRCodePlaceHolder is a place holder for DNS_RCODE
//
// Values that could be NOERROR, FORMERR, SERVFAIL, NXDOMAIN, NOTIMP and REFUSED
DNSRCode = "[DNS_RCODE]"
DNSRCodePlaceHolder = "[DNS_RCODE]"
// ResponseTimePlaceHolder is a placeholder for the request response time, in milliseconds.
//
@ -148,7 +148,7 @@ func sanitizeAndResolve(list []string, result *Result) []string {
element = result.IP
case ResponseTimePlaceHolder:
element = strconv.Itoa(int(result.Duration.Milliseconds()))
case DNSRCode:
case DNSRCodePlaceHolder:
element = result.DNSRCode
case BodyPlaceHolder:
element = body