Menu

#Stdlib

10 posts

Feed·
10 of 10 posts
sync.OnceFunc, OnceValue, OnceValues: When Each Beats sync.Once
📰
0Read More

sync.OnceFunc, OnceValue, OnceValues: When Each Beats sync.Once

DEV Community·Gabriel Anhaia·7 months ago
#LC3Cy0Cn
#concurrency#go#stdlib#once#sync

Go 1.21's sync.OnceFunc / OnceValue / OnceValues vs sync.Once. When each is the cleanest, the error-return trap, init patterns.

15s
context.WithoutCancel: When You Need Work That Outlives Its Caller
📰
0Read More

context.WithoutCancel: When You Need Work That Outlives Its Caller

DEV Community·Gabriel Anhaia·7 months ago
#YAXGzgdR
#go#concurrency#stdlib#backend#context

context.WithoutCancel keeps work alive past caller cancellation while keeping context values. Pattern, the deadline trap, and where Background fails.

15s
The maps Stdlib in Go 1.21+: 8 Functions That Replace Half Your Map Helpers
📰
0Read More

The maps Stdlib in Go 1.21+: 8 Functions That Replace Half Your Map Helpers

DEV Community·Gabriel Anhaia·7 months ago
#DbH9IB7c
#go#stdlib#generics#backend#maps

Go's maps stdlib package: 8 functions that delete handwritten helpers. Keys/Values/Clone/Copy/DeleteFunc/Equal + the iter.Seq trap.

15s