refactor(resolver): add CloseIdleConnections to SerialResolver (#502)

While there, generally convert more code to internal testing
and to using pointer receivers as well.

Part of https://github.com/ooni/probe/issues/1591.
This commit is contained in:
Simone Basso 2021-09-09 20:58:04 +02:00 committed by GitHub
commit b3c36b5c7f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 55 additions and 52 deletions

View file

@ -22,7 +22,7 @@ const (
)
// Encode implements Encoder.Encode
func (e MiekgEncoder) Encode(domain string, qtype uint16, padding bool) ([]byte, error) {
func (e *MiekgEncoder) Encode(domain string, qtype uint16, padding bool) ([]byte, error) {
question := dns.Question{
Name: dns.Fqdn(domain),
Qtype: qtype,
@ -49,4 +49,4 @@ func (e MiekgEncoder) Encode(domain string, qtype uint16, padding bool) ([]byte,
return query.Pack()
}
var _ Encoder = MiekgEncoder{}
var _ Encoder = &MiekgEncoder{}