Go
Open in Telegram
// admin @denniselite go func() { channel <- news }() news := <-channel fmt.Sprintf("%s", news)
Show moreThe country is not specifiedTechnologies & Applications429
19 455
Subscribers
-424 hours
-177 days
-7330 days
Posts Archive
Hello, folks, it's bee a while. Re-sharing an interetsting recording from GopherCon 2025:
Advancing Go Garbage Collection with Green Tea (youtube). TL;DR:
Go 1.25 includes a new experimental garbage collector called Green Tea, available by setting GOEXPERIMENT=greenteagc at build time. Many workloads spend around 10% less time in the garbage collector, but some workloads see a reduction of up to 40%!
There is an also official text version on the Green Tea Garbage Collector if one does not like to watch the video.
Thanks!
π 45β€ 21π₯ 5π€― 3π 1
Be Careful with Go Struct Embedding
Embedding structs can quietly mask deeper-nested fields: a duplicate field name isnβt ambiguous unless it appears at the same βdepthβ, meaning your program may choose an unintended value.
https://mattjhall.co.uk/posts/be-careful-with-go-struct-embedding.html
π 52π₯ 11π€ 7β€ 2π 2
Photo unavailableShow in Telegram
[ On | No ] syntactic support for error handling
The Go team has published a proposal for a new error handling syntax, aiming to simplify common error handling patterns without introducing exceptions or complex control flow.
A new optional check built-in would allow the following syntax:
func foo() error {
x, e := check bar()
y, e := check baz(x)
return nil
}
Behind the scenes, check would automatically return the error if one occurs, making common patterns more concise while keeping Goβs explicit error handling philosophy.
https://go.dev/blog/error-syntax
π 82π 40π© 12π€ 10π 3β€ 2π₯ 1
What's new in Go: Google I/O presentation
https://www.youtube.com/watch?v=kj80m-umOxs&ab_channel=GoogleforDevelopers
β€ 49π 30π© 5π₯ 3π 2
Go 1.24: A Major Improvement for Tooling: go tools π
Hello, folks! The upcoming Go 1.24 (supposed to be coming this month, Feb 2025) introduces a new
go tool command, aiming to significantly improve the way project-specific tools are managed. This update eliminates the need for the tools.go workaround, reduces dependency bloat, and improves performance through caching. So,
- No more tools.go hacks
- Faster execution with caching
- Cleaner and more efficient dependency management
How it works? Simple!
Add a tool:
go get -tool github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen@v2.4.1
Run it:
go tool github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen --config=config.yaml openapi.yaml
List available tools:
go toolSome people say this is one of the most useful changes to Go's tooling in years, making project setups more efficient and maintainable, so take a look in more details here https://www.jvt.me/posts/2025/01/27/go-tools-124/ π PS More official docs can be found in the Go 1.24's release notes here: https://tip.golang.org/doc/go1.24#tools
π 86β€ 28π₯ 16π 6π 2π€ 2
Hello, dear community!
I wish you Merry Christmas π Happy New Year π and great winter holidays ahead!βοΈ βοΈ
See you in 2025 π
β€ 365π 72π₯ 41π 6π© 4π€ 2
Coming in Go 1.24: testing/synctest experiment for time and concurrency testing
Testing code that involves time or concurrency can be a struggle. It often leads to hard-to-debug flakes in CI or long-running tests.
Go 1.24 is scheduled to be released in February and the release freeze has begun.
Itβs set to include an experimental
testing/synctest package designed to make testing code that involves time or concurrency precise and fast.
https://danp.net/posts/synctest-experiment/β€ 76π 30π₯ 8π 5π€― 5π€ 2π© 1
Go Blueprint: A Quick Way to Start Go Projects β
The tool helps you setting up new Go projects fast, with ready-made templates and all the basic setup done for you.
While Iβm not really into using tools like this, some might find it useful to save time and focus on development.
From the authors: "Powerful CLI tool designed to streamline the process of creating Go projects with a robust and standardized structure. Not only does Go Blueprint facilitate project initialization, but it also offers seamless integration with popular Go frameworks, allowing you to focus on your application's code from the very beginning."
https://docs.go-blueprint.dev/
π₯ 46π 27β€ 13π 3π€ 1
Go sync.Map: The Right Tool for the Right Job
In Go, sync.Map offers a thread-safe alternative to traditional maps. While sync.Map can be highly effective in scenarios involving heavy concurrent access, it isn't always the best choice. In this article by VictoriaMetrics, you'll learn when to opt for sync.Map, how it differs from regular maps, and the performance trade-offs involved.
https://victoriametrics.com/blog/go-sync-map/index.html
π 26π 12β€ 5
The standard library of Go 1.23 now includes the new unique package. The purpose behind this package is to enable the canonicalization of comparable values. In other words, this package lets you deduplicate values so that they point to a single, canonical, unique copy, while efficiently managing the canonical copies under the hood. You might be familiar with this concept already, called βinterningβ. Letβs dive in to see how it works, and why itβs useful.
https://go.dev/blog/unique
π₯ 57β€ 14π 10π 8
If you use
Timer.Reset() in Go 1.22 or earlier, you may be doing it wrong. Even the book 100 Go Mistakes (which is usually right about Go nuances) got it wrong.
Let's see what the problem might be and how to work around it.
https://antonz.org/timer-reset/π€― 38π 30π₯ 7π€ 7π 5β€ 5
Photo unavailableShow in Telegram
Profile-guided optimisation (PGO) is a technique where CPU profile data for an application is collected and fed back into the next compiler build of Go application. The compiler then uses this CPU profile data to optimise the performance of that build by around 2-14% currently (future releases could likely improve this figure further).
In this article, the Grab tech folks show off their wins and learnings, along with the Dockerfile used to make it happen.
https://engineering.grab.com/profile-guided-optimisation
Enjoy!
β€ 38π 20π₯ 6π 1
Okay based on the first reactions it seems like the naming convention issue brought by Zach didn't get much reflection in you.
In this case, I'd like to share a more practical guidance I used recently when had to test a k8s operator setup locally.
The topic is:
Go: Testing Kubernetes Applications with EnvTest
Enjoy π
https://blog.marcnuri.com/go-testing-kubernetes-applications-envtest
π₯ 31π 9β€ 4π 2π€― 1
Photo unavailableShow in Telegram
"ok" considered harmful?
βJust like thereβs an unwritten law that every error variable in Go must be named err, thereβs an unwritten law that every map existence variable in Go must be named ok.β
But Zach thinks we can, and should, look at doing better.
https://www.dolthub.com/blog/2024-05-10-ok-considered-harmful/
π 86π 32π€ 19π© 6β€ 3π€― 3π₯ 2
https://go.dev/blog/chacha8rand
Explore the recent advancements in randomness within the Go programming language. Authors Russ Cox and Filippo Valsorda, part of the Go team, look closely at the complexities of addressing security requirements for specific use cases and the implementation of the ChaCha(Rand8) algorithm. Discover how these improvements have enhanced random number generation in Go, culminating in the seamless security enhancements introduced in Go 1.22.
π 36π₯ 10β€ 3π 2
Mastering Maps in Go: Everything You Need to Know
Maps, also known as associative arrays or hash tables, are vital data structures for solving algorithmic problems in programming. Understanding their features, operations, time and space complexities, and implementation in code is crucial for developers. With this knowledge and practical experience, developers can effectively apply maps to problem-solving scenarios.
This article offers a comprehensive guide to using maps, covering their overview, implementation in Go programming, and strategies for using them in concurrent code.
β€ 36π 13π₯ 4π€― 4π 3π 2
The Impact of Pre-Allocating Slice Memory on Performance β The author wanted to establish, in numbers, how pre-allocating memory improves performance using quantitative measurements and tools for automated detection.
β€ 38π 20π 3π 2π₯ 2π€ 1
Photo unavailableShow in Telegram
Initial Thoughts on Go 1.22 β 1.22 is due next month, but the release candidate gives us a look at plenty of changes and improvements coming down the pike, including new default behavior for loop variables in for loops, the βrangefuncβ experiment (more on that next), and even some performance improvements.
https://www.dolthub.com/blog/2024-01-12-golang-1-22rc/
π₯ 56β€ 21π 16π€― 6π 5
https://threedots.tech/post/making-games-in-go/
MiΕosz uses the much loved Ebitengine to create a simple Asteroids game. Thereβs a lot to cover, but the steps are small and easy to digest if youβre looking to understand how games are made.
π 39β€ 12π₯ 8π€ 2
Logging in Go: A Comparison of the Top 8 Libraries
There's probably a 99% chance that if you're logging in Go, you're using a third-party logging framework since the built-in log package lacks even the most basic features required for production logging. This recently changed with the release of Go 1.21 where the new log/slog package for structured, leveled, and context-aware logging was one of the major highlights.
https://betterstack.com/community/guides/logging/best-golang-logging-libraries/
π 80β€ 28π 15
