From 3f02602db8cfe6fbb09d550ac723fc251eb81f1d Mon Sep 17 00:00:00 2001 From: Shulhan Date: Sun, 14 Nov 2021 17:46:02 +0700 Subject: lib/dns: refactoring, create type RecordType to represent type of RR Previously, we use uint16 to represent type for ResourceRecord Type or Question type. To make the code more strict, where parameter or return value, must be expected as record type, we add new type to represent the RR type: RecordType. This changes also rename any variable name of QType or qtype to RType or rtype because QType is misleading. The type defined the ResourceRecord to be queried not only question. --- lib/dns/server_example_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/dns/server_example_test.go') diff --git a/lib/dns/server_example_test.go b/lib/dns/server_example_test.go index a2a69eb7..e58977e9 100644 --- a/lib/dns/server_example_test.go +++ b/lib/dns/server_example_test.go @@ -15,7 +15,7 @@ func clientLookup(nameserver string) { return } - msg, err := cl.Lookup(false, dns.QueryTypeA, dns.QueryClassIN, + msg, err := cl.Lookup(false, dns.RecordTypeA, dns.QueryClassIN, "kilabit.info") if err != nil { log.Println(err) -- cgit v1.3