<commit_before>package main

import (
	"dns"
	"fmt"
	"time"
)

func main() {
	res := new(dns.Resolver) // create a new resolver

	// Create a new message
	m := new(dns.Msg)
	m.MsgHdr.Recursion_desired = true //only set this bit
	m.Question = make([]dns.Question, 1)
	m.Question[0] = dns.Question{"miek.nl", dns.TypeSOA, dns.ClassINET}

	// send config (or res with Query)

	msgch := make(chan dns.MsgErr)
	qch := make(chan bool)

	// start the resolver
	go dns.Query(res, msgch, qch)

	// configure the resolver
	res.Servers = []string{"192.168.1.2"}
	res.Timeout = 2
	res.Attempts = 1

	// ask something
	msgch <- dns.MsgErr{m, nil}

	// wait for an reply
	in := <-msgch
	fmt.Printf("%v\n", in.M)
	// kill resolver
	// qch <- true does not work yet

	m.Question[0] = dns.Question{"a.miek.nl", dns.TypeTXT, dns.ClassINET}
	// ask something
	msgch <- dns.MsgErr{m, nil}
	// wait for an reply
	in = <-msgch
	fmt.Printf("%v\n", in.M)

	m.Question[0] = dns.Question{"miek.nl", dns.TypeTXT, dns.ClassINET}
	// ask something
	msgch <- dns.MsgErr{m, nil}
	// wait for an reply
	in = <-msgch
	fmt.Printf("%v\n", in.M)



	time.Sleep(2.0e9)

	/*
		a := new(dns.RR_A)
		a.A = net.ParseIP("192.168.1.2").To4()

		aaaa := new(dns.RR_AAAA)
		aaaa.AAAA = net.ParseIP("fd00:a516:7c1b:17cd:6d81:2137:bd2a:2c5b").To16()

		fmt.Printf("%v\n", a)
		fmt.Printf("%v\n", aaaa)

	//	msg, _ := res.Query("miek.nl.", dns.TypeTXT, dns.ClassINET)
	//
	//	msg, _ = res.Query("www.nlnetlabs.nl", dns.TypeAAAA, dns.ClassINET)
	//	fmt.Printf("%v\n", msg)
	//
		msg, _ := res.Query("nlnetlabs.nl", dns.TypeDNSKEY, dns.ClassINET)
		fmt.Printf("%v\n", msg)

		msg, _ = res.Query("jelte.nlnetlabs.nl", dns.TypeDS, dns.ClassINET)
		fmt.Printf("%v\n", msg)
	*/
}<commit_msg>small tweaks<commit_after>package main

import (
	"dns"
	"fmt"
	"time"
)

func main() {
	res := new(dns.Resolver) // create a new resolver

	// Create a new message
	m := new(dns.Msg)
	m.MsgHdr.Recursion_desired = true //only set this bit
	m.Question = make([]dns.Question, 1)
	m.Question[0] = dns.Question{"miek.nl", dns.TypeSOA, dns.ClassINET}

	// send config (or res with Query)

	msgch := make(chan dns.MsgErr)
	qch := make(chan bool)

	// start the resolver
	go dns.Query(res, msgch, qch)

	// configure the resolver
	res.Servers = []string{"192.168.1.2"}
	res.Timeout = 2
	res.Attempts = 1

	// Setup done, now for some real work

	// ask something
	msgch <- dns.MsgErr{m, nil}

	// wait for an reply
	in := <-msgch
	fmt.Printf("%v\n", in.M)
	// kill resolver
	// qch <- true does not work yet

	m.Question[0] = dns.Question{"a.miek.nl", dns.TypeTXT, dns.ClassINET}
	msgch <- dns.MsgErr{m, nil}
	// wait for an reply
	in = <-msgch
	fmt.Printf("%v\n", in.M)

	m.Question[0] = dns.Question{"miek.nl", dns.TypeTXT, dns.ClassINET}
	// ask something
	msgch <- dns.MsgErr{m, nil}
	// wait for an reply
	in = <-msgch
	fmt.Printf("%v\n", in.M)

	time.Sleep(2.0e9) // wait for Go routine to do something
}
{'fraction_non_alphanumeric': 0.18639455782312925, 'fraction_numerical': 0.021768707482993196, 'mean_word_length': 3.090403337969402, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 3, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5056432', 'n_tokens_mistral': 1363, 'n_tokens_neox': 1289, 'n_words': 281}