Part of the Accepted! series, explaining the upcoming Go changes in simple terms.

Add context-aware, network-specific methods to the net.Dialer type.

Ver. 1.26 • Stdlib • Low impact

Summary

The net.Dialer type connects to the address using a given network (protocol) — TCP, UDP, IP, or Unix sockets.

The new context-aware Dialer methods (DialTCP, DialUDP, DialIP, and DialUnix) combine the efficiency of the existing network-specific net functions (which skip address resolution and dispatch) with the cancellation capabilities of Dialer.DialContext.

Motivation

The net package already has top-level functions for different networks (DialTCP, DialUDP, DialIP, and DialUnix), but these were made before `…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help