Skip to content

Commit cb3b8c4

Browse files
authored
Switch to DialContext() to address lint issue (#1107)
1 parent 3872026 commit cb3b8c4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

exporter.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,9 @@ func registerCollector(logger *slog.Logger, transport *http.Transport,
230230
os.Exit(1)
231231
}
232232

233-
transport.DialContext = func(_ context.Context, _, _ string) (net.Conn, error) {
234-
return net.Dial("unix", socketPath)
233+
transport.DialContext = func(ctx context.Context, _, _ string) (net.Conn, error) {
234+
d := &net.Dialer{}
235+
return d.DialContext(ctx, "unix", socketPath)
235236
}
236237
addr = "http://unix" + requestPath
237238
}

0 commit comments

Comments
 (0)