Remove ToString0[T] usage to fix golangci-lint

This commit is contained in:
世界
2022-07-10 22:00:28 +08:00
parent 0ef2e330e3
commit 6048b1e270
24 changed files with 59 additions and 99 deletions

View File

@@ -63,11 +63,10 @@ func (t *HTTPSTransport) Exchange(ctx context.Context, message *dnsmessage.Messa
return nil, err
}
buffer.Truncate(len(rawMessage))
request, err := http.NewRequest(http.MethodPost, t.destination, bytes.NewReader(buffer.Bytes()))
request, err := http.NewRequestWithContext(ctx, http.MethodPost, t.destination, bytes.NewReader(buffer.Bytes()))
if err != nil {
return nil, err
}
request.WithContext(ctx)
request.Header.Set("content-type", dnsMimeType)
request.Header.Set("accept", dnsMimeType)