- I’m Terin!
- Software Developer at Cloudflare
- Been developing in Go since Go 1.4
- Fix to
net/http
’s Pusher implementation causing connection resets in Firefox and Safari. - Various bug fixes to the compiler, linker, and runtime.
- Incorrect parse of path prefix
\??\
, leading to arbitrary file access. - Incorrect detection of reserved file names (eg,
COM1
andLPT1
) as local in some circumstances.
- First standard library package to get a “v2” redesign.
- Top-level functions were modified to make it easier to use.
- Removes ability to get random bytes by removing
Rand.Read
. - Removes top-level
Seed
,Rand.Seed
, andSource.Seed
. - Replaces
Source.Int63
withSource.Uint64
. - Removes the original Linear-Feedback Shift Register source, and adds PCG-DXSM and ChaCha8 as source options.
- Add compiler support for new for-range loops behind
GOEXPERIMENT=range
flag.
The C-style loop over integers like
for x := 0; x < 10; x++ { }
would become
for x := range 10 {
// x will be in the range 0..n-1
}
Allows looping over coroutine functions.
type f function(yield func(T1, T2) bool) bool
for x, y := range f {
// the control statements "break", "continue", "return"
// still work like normal within this for loop.
}
- See Russ Cox’s Coroutines with Go blog post for more details.
- Go sets the TCP keepalive timeout (
TCP_KEEPINTVL
) to 15 seconds.- Setting
KeepAlive
onnet.Dialer
allows sending keepalives more often. - Reports from mobile users that this keeps devices and radios awake.
- Setting
- Proposal adds
KeepAliveConfig
option tonet.Dialer
, and addsSetKeepAliveConfig
onTCPConn
.
client := http.Client{
Transport: &http.Transport{
DialContext: &net.Dialer{
KeepAliveConfig: net.KeepAliveConfig{
Enable: true,
Idle: 5*time.Second,
Interval: 30*time.Second,
Count: 3,
}
}
}
}
- Allows creating a weak reference to values by retaining references to Lisp-like symbols.
- Brings a version of go4.org/intern to the standard library.
- Can be used to weakly store one-copy of a string, with fast comparison.
func (ip Addr) WithZone(zone string) Addr {
ip.z = unique.Make(zone)
}