Go slice gotchas 🔨
Just like any other dynamically growable container structure, Go slices come with a few gotchas. We don’t always remember all the rules we need to be aware of. So this is an attempt to list some of the most common mistakes I’ve made at least once.
Link to the article
#go #go@digest_golang #article #article@digest_golang
Just like any other dynamically growable container structure, Go slices come with a few gotchas. We don’t always remember all the rules we need to be aware of. So this is an attempt to list some of the most common mistakes I’ve made at least once.
Link to the article
#go #go@digest_golang #article #article@digest_golang
Please open Telegram to view this post
VIEW IN TELEGRAM
A round up of Go 1.24's performance improvements ❤️
We all want our code to run as fast as possible. But have you ever stopped to wonder how many microseconds it takes to do a map lookup in Go? Or how much memory gets allocated when you create a small object? The Go team thinks about this stuff constantly, and in Go 1.24, they’ve made some pretty exciting improvements that make everything about 2-3% faster.
Link to the article
#go #go@digest_golang #article #article@digest_golang
We all want our code to run as fast as possible. But have you ever stopped to wonder how many microseconds it takes to do a map lookup in Go? Or how much memory gets allocated when you create a small object? The Go team thinks about this stuff constantly, and in Go 1.24, they’ve made some pretty exciting improvements that make everything about 2-3% faster.
Link to the article
#go #go@digest_golang #article #article@digest_golang
Please open Telegram to view this post
VIEW IN TELEGRAM
Go's map does not shrink 👾
Go's map does not shrink (in terms of allocated memory). Sorry, but it just doesn't...
Link to the article
#go #go@digest_golang #article #article@digest_golang
Go's map does not shrink (in terms of allocated memory). Sorry, but it just doesn't...
Link to the article
#go #go@digest_golang #article #article@digest_golang
Please open Telegram to view this post
VIEW IN TELEGRAM
Go 1.24 is released! ❤️
Go 1.24 comes with many improvements over Go 1.23. Here are some of the notable changes; for the full list, refer to the release notes.
The main changes in this version are:
* The go tool mechanism for tracking tool dependencies
* The use of Swiss Tables to speed up map operations
* Experimental testing/synctest package for testing concurrent code
* Improved WebAssembly support
* and much more, for details see the link: https://go.dev/blog/go1.24
#go #go@digest_golang #goblog #goblog@digest_golang
Go 1.24 comes with many improvements over Go 1.23. Here are some of the notable changes; for the full list, refer to the release notes.
The main changes in this version are:
* The go tool mechanism for tracking tool dependencies
* The use of Swiss Tables to speed up map operations
* Experimental testing/synctest package for testing concurrent code
* Improved WebAssembly support
* and much more, for details see the link: https://go.dev/blog/go1.24
#go #go@digest_golang #goblog #goblog@digest_golang
Please open Telegram to view this post
VIEW IN TELEGRAM
How Protobuf Works—The Art of Data Encoding 💪
Protobuf (Protocol Buffers) is a way to serialize data into a compact binary format. This makes it smaller in size and faster to transmit over the network, though at the cost of being less human-readable.
Let’s run a simple benchmark comparing
Link to the article
#go #go@digest_golang #article #article@digest_golang
Protobuf (Protocol Buffers) is a way to serialize data into a compact binary format. This makes it smaller in size and faster to transmit over the network, though at the cost of being less human-readable.
Let’s run a simple benchmark comparing
google.golang.org/protobuf
and encoding/json
in Go. While this may not be a perfectly fair comparison, it will reflect common choices.Link to the article
#go #go@digest_golang #article #article@digest_golang
Please open Telegram to view this post
VIEW IN TELEGRAM
Extensible Wasm Applications with Go 📆
Go 1.24 enhances its WebAssembly (Wasm) capabilities with the addition of the
Link to the article
#go #go@digest_golang #article #article@digest_golang #goblog #goblog@digest_golang
Go 1.24 enhances its WebAssembly (Wasm) capabilities with the addition of the
go:wasmexport
directive and the ability to build a reactor for WebAssembly System Interface (WASI). These features enable Go developers to export Go functions to Wasm, facilitating better integration with Wasm hosts and expanding the possibilities for Go-based Wasm applications.Link to the article
#go #go@digest_golang #article #article@digest_golang #goblog #goblog@digest_golang
Please open Telegram to view this post
VIEW IN TELEGRAM
Map internals in Go 1.24 🔨
Maps in Go 1.24 have undergone a complete rewrite, significantly improving their performance. The new implementation draws inspiration from Google's high-performance hash map design known as Swiss Tables.
Let's figure out how they work now.
Link to the article
#go #go@digest_golang #article #article@digest_golang
Maps in Go 1.24 have undergone a complete rewrite, significantly improving their performance. The new implementation draws inspiration from Google's high-performance hash map design known as Swiss Tables.
Let's figure out how they work now.
Link to the article
#go #go@digest_golang #article #article@digest_golang
Please open Telegram to view this post
VIEW IN TELEGRAM
A database written fully in Go 🔨
A Reddit user shared their project — a minimalist persistent relational database written in Go. The main focus was on storage management and transactions. Indexes are implemented using a B+ Tree, and parallel data reading is supported.
Awesome project!
Link to the repo
#go #go@digest_golang #project #project@digest_golang
A Reddit user shared their project — a minimalist persistent relational database written in Go. The main focus was on storage management and transactions. Indexes are implemented using a B+ Tree, and parallel data reading is supported.
Awesome project!
Link to the repo
#go #go@digest_golang #project #project@digest_golang
Please open Telegram to view this post
VIEW IN TELEGRAM
Testing concurrent code with testing/synctest 🤓
One of Go’s signature features is built-in support for concurrency. Goroutines and channels are simple and effective primitives for writing concurrent programs.However, testing concurrent programs can be difficult and error prone.
In Go 1.24, the go team are introducing a new, experimental testing/synctest package to support testing concurrent code. This post will explain the motivation behind this experiment, demonstrate how to use the synctest package, and discuss its potential future.
Link to the article
#go #go@digest_golang #article #article@digest_golang #goblog #goblog@digest_golang
One of Go’s signature features is built-in support for concurrency. Goroutines and channels are simple and effective primitives for writing concurrent programs.However, testing concurrent programs can be difficult and error prone.
In Go 1.24, the go team are introducing a new, experimental testing/synctest package to support testing concurrent code. This post will explain the motivation behind this experiment, demonstrate how to use the synctest package, and discuss its potential future.
Link to the article
#go #go@digest_golang #article #article@digest_golang #goblog #goblog@digest_golang
Please open Telegram to view this post
VIEW IN TELEGRAM
How to manage tool dependencies in Go 1.24+ 📆
Historically, managing dependencies — especially in a team setting — has been tricky. The previous solutions have been to use a tools.go file or the go run pattern, but while these approaches work, they’ve always felt like workarounds with some downsides.
With Go 1.24, there’s finally a better way.
Link to the article
#go #go@digest_golang #article #article@digest_golang
Historically, managing dependencies — especially in a team setting — has been tricky. The previous solutions have been to use a tools.go file or the go run pattern, but while these approaches work, they’ve always felt like workarounds with some downsides.
With Go 1.24, there’s finally a better way.
Link to the article
#go #go@digest_golang #article #article@digest_golang
Please open Telegram to view this post
VIEW IN TELEGRAM
Faster Go maps with Swiss Tables 📆
Go 1.24 includes a completely new implementation of the built-in map type, based on the Swiss Table design. In this blog post we’ll look at how Swiss Tables improve upon traditional hash tables, and at some of the unique challenges in bringing the Swiss Table design to Go’s maps.
Link to the article
#go #go@digest_golang #article #article@digest_golang #goblog #goblog@digest_golang
Go 1.24 includes a completely new implementation of the built-in map type, based on the Swiss Table design. In this blog post we’ll look at how Swiss Tables improve upon traditional hash tables, and at some of the unique challenges in bringing the Swiss Table design to Go’s maps.
Link to the article
#go #go@digest_golang #article #article@digest_golang #goblog #goblog@digest_golang
Please open Telegram to view this post
VIEW IN TELEGRAM
Tips to debug hanging Go programs 📆
If your Go app becomes unresponsive, these tips can help you identify the issue by forcing a stack trace or using Delve to attach to the process (or core dump) and revive the program.
Link to the article
#go #go@digest_golang #article #article@digest_golang
If your Go app becomes unresponsive, these tips can help you identify the issue by forcing a stack trace or using Delve to attach to the process (or core dump) and revive the program.
Link to the article
#go #go@digest_golang #article #article@digest_golang
Please open Telegram to view this post
VIEW IN TELEGRAM
Different ways of working with SQL Databases in Go 👴
In this article, we'll explore and compare most popularly used Go packages for relational databases with hands-on examples, pros and cons. We will also briefly touch on the topic of database migrations and how to manage them in Go.
Link to the article
#go #go@digest_golang #article #article@digest_golang
In this article, we'll explore and compare most popularly used Go packages for relational databases with hands-on examples, pros and cons. We will also briefly touch on the topic of database migrations and how to manage them in Go.
Link to the article
#go #go@digest_golang #article #article@digest_golang
Please open Telegram to view this post
VIEW IN TELEGRAM
From unique to cleanups and weak: new low-level tools for efficiency ❤️
An overview of two new features in Go 1.24’s garbage collector: runtime.AddCleanup and weak.Pointer. Cleanups work similarly to finalizers but avoid some of their issues by not reviving the objects they are linked to. Weak pointers allow referencing objects without stopping them from being garbage collected.
Link to the article
#go #go@digest_golang #article #article@digest_golang #goblog #goblog@digest_golang
An overview of two new features in Go 1.24’s garbage collector: runtime.AddCleanup and weak.Pointer. Cleanups work similarly to finalizers but avoid some of their issues by not reviving the objects they are linked to. Weak pointers allow referencing objects without stopping them from being garbage collected.
Link to the article
#go #go@digest_golang #article #article@digest_golang #goblog #goblog@digest_golang
Please open Telegram to view this post
VIEW IN TELEGRAM
go.dev
From unique to cleanups and weak: new low-level tools for efficiency - The Go Programming Language
Weak pointers and better finalization in Go 1.24.
Go Structs and Interfaces Made Simple 🔨
In this blog post, we'll demystify Go's structs and interfaces, exploring how they differ from classes in traditional OOP languages and why Go's approach leads to more maintainable and flexible code. Whether you're new to Go or have been using it without fully grasping these concepts, this guide aims to make these foundational elements click.
Link to the article
#go #go@digest_golang #article #article@digest_golang
In this blog post, we'll demystify Go's structs and interfaces, exploring how they differ from classes in traditional OOP languages and why Go's approach leads to more maintainable and flexible code. Whether you're new to Go or have been using it without fully grasping these concepts, this guide aims to make these foundational elements click.
Link to the article
#go #go@digest_golang #article #article@digest_golang
Please open Telegram to view this post
VIEW IN TELEGRAM
golangci-lint v2 ❤️
The second version of the most popular linter for go has been released: golangci-lint!
In this article, the author explains what has changed and what has been improved.
Link to the release note
#go #go@digest_golang #article #article@digest_golang
The second version of the most popular linter for go has been released: golangci-lint!
In this article, the author explains what has changed and what has been improved.
Link to the release note
#go #go@digest_golang #article #article@digest_golang
Please open Telegram to view this post
VIEW IN TELEGRAM
Faster interpreters in Go: Catching up with C++ 💪
PlanetScale is a popular cloud-based MySQL hosting service that uses Vitess, a MySQL scaler built with Go. This article tells the story of creating a virtual machine in Go to work with the SQL ASTs generated by their SQL parser—and how it performs as fast or even faster than MySQL’s C++ implementation.
Link to the article
#go #go@digest_golang #article #article@digest_golang
PlanetScale is a popular cloud-based MySQL hosting service that uses Vitess, a MySQL scaler built with Go. This article tells the story of creating a virtual machine in Go to work with the SQL ASTs generated by their SQL parser—and how it performs as fast or even faster than MySQL’s C++ implementation.
Link to the article
#go #go@digest_golang #article #article@digest_golang
Please open Telegram to view this post
VIEW IN TELEGRAM