Golang Digest
2.53K subscribers
164 photos
1 video
190 links
Everything about Go: news, articles, tools, language changes, etc.

#go #golang #concurrency #postgres #database #db
Download Telegram
๐Ÿค“ Slices in Go: Grow Big or Go Home

An in-depth exploration of slices, emphasizing how they expandโ€”a detail that can catch you off guard in your code if youโ€™re not aware of it.

Link to the article

#go #article #slices
Please open Telegram to view this post
VIEW IN TELEGRAM
5๐Ÿ‘3๐Ÿ‘พ2
Dumb ways to die: Random Values in Pointers ๐Ÿค“

Storing non-pointer values in unsafe.Pointer is generally a bad Idea, but why is that the case? What actually happens? Exploring this could provide you with a deeper understanding of pointers and the unsafe package.

Link to the article

#go #article #pointers
Please open Telegram to view this post
VIEW IN TELEGRAM
4๐Ÿ‘2๐Ÿ˜1๐Ÿ‘พ1
Mastering ISO 8583 Message Networking with Golang โค๏ธ

This article discusses how to implement networking for ISO 8583 financial transaction messages using Golang. It covers the creation of a Golang client to send and receive ISO 8583 messages over TCP/IP, focusing on asynchronous processing, message interleaving, and binary framing.

Link to the article

#go #article
Please open Telegram to view this post
VIEW IN TELEGRAM
๐Ÿ‘53๐Ÿ‘พ1
Telemetry in Go 1.23 and beyond ๐Ÿ‘พ

Go 1.23 provides a new way for you to help improve the Go toolchain. By enabling telemetry uploading, you can elect to share data about toolchain programs and their usage with the Go team. This data will help Go contributors fix bugs, avoid regressions, and make better decisions.


https://go.dev/blog/gotelemetry

#go #article #goblog
Please open Telegram to view this post
VIEW IN TELEGRAM
๐Ÿ‘53๐Ÿ‘€1
How Go Tests "go test" ๐Ÿ‘พ

How does Go, the project, and team behind it, test go test, the Go tool's command for running tests? Does Go test go test using the go test command? In this article, we explore the evolution of how the Go team tests the Go tool (go) and discuss strategies for testing command-line tools written in Go in general.


Link to the article

#go #article
Please open Telegram to view this post
VIEW IN TELEGRAM
๐Ÿ‘8๐Ÿ”ฅ1
Building LLM-powered applications in Go โค๏ธ

The post explores various methods for setting up a Retrieval-Augmented Generation (RAG) server using different toolchains: Gemini + Weaviate, LangChain, and Genkit. Goโ€™s inherent strengths appear to align well with the demands of the modern LLM/RAG ecosystem.

https://go.dev/blog/llmpowered

#go #article #goblog
Please open Telegram to view this post
VIEW IN TELEGRAM
๐Ÿ‘54๐Ÿ”ฅ1
Notes on running Go in the browser with WebAssembly ๐Ÿ‘พ

Eli covers the basics of invoking Go from JavaScript, manipulating the DOM, using TinyGo to reduce the size of the resulting WASM binary, and running tasks concurrently with Web Workers.

Lint to the article

#go #article
Please open Telegram to view this post
VIEW IN TELEGRAM
๐Ÿ”ฅ3๐Ÿ‘21
Using Go instead of bash for scripts ๐Ÿ‘พ

Replacing your scripts with Go allows you to write them once for all platforms, eliminating the need to relearn OS-specific scripting languages. While it may involve more code, the trade-off could be well worth it.

Link to the article

#go #article
Please open Telegram to view this post
VIEW IN TELEGRAM
๐Ÿ‘6๐Ÿค”42
What's in an (Alias) Name? ๐Ÿค“

Generic alias types are set to arrive in Go 1.24 (anticipated in February 2025) as part of this proposal, expanding on both type aliases and generics. One key use case for type aliases is enabling refactoring without breaking compatibility. Robert breaks down the fundamentals of type aliases and explains why integrating them with generics required additional effort.

https://go.dev/blog/alias-names

#go #article #goblog
Please open Telegram to view this post
VIEW IN TELEGRAM
5๐Ÿ‘3
Sets in Go ๐Ÿค“

Go doesnโ€™t offer a native set type, and the standard library doesnโ€™t provide one either. So, how do you create sets in Go?


Link to the article

#go #article #gomap #map
Please open Telegram to view this post
VIEW IN TELEGRAM
๐Ÿ‘6๐Ÿ”ฅ3๐Ÿฅฐ11
Joining errors in Go ๐Ÿคก

A useful comparison of two methods: employing multiple %w verbs and leveraging errors.Join, introduced in Go 1.20.

Link to the article

#go #article
Please open Telegram to view this post
VIEW IN TELEGRAM
๐Ÿ‘43
Writing raw SQL easier with pgx and sqlc in Go ๐Ÿค“

The author offers several tips and solutions on how to use pgx and sqlc to simplify writing sql code.

Link to the article

#go #article #sql
Please open Telegram to view this post
VIEW IN TELEGRAM
5๐Ÿ‘3๐Ÿ‘พ1
6 Tips for Using Strings in Go ๐Ÿค“

If you are coming to Go from another language like Ruby or Python there are a lot of changes to take in, and many of these revolve around the string type. Below is a list of some quick tips that answered questions I had during my first few weeks using Golang.

Link to the article

#go #article #strings
Please open Telegram to view this post
VIEW IN TELEGRAM
6๐Ÿ‘4๐Ÿ”ฅ2
Database Transactions in Go with Layered Architecture

This article on Three Dots Labs talks about handling database transactions in Go using a layered architecture. It covers how to structure repositories for clean transaction management, keeping logic in command handlers, and using domain models effectively. It also explains the UpdateFn pattern for updating data in a neat way and the Transaction Provider pattern for managing transactions across multiple repositories without overcomplicating things

Link to the article

#go #article
๐Ÿ‘5๐Ÿ”ฅ43โค1
Go sync.Map: The Right Tool for the Right Job โค๏ธ

The newest edition of Phuongโ€™s acclaimed, illustrated handbook on Go concurrency explores sync.Map, a thread-safe map that allows concurrent reads and writes across multiple goroutines without the need for explicit locking. However, as Phuong discovers, it isnโ€™t always the optimal solution.

Link to the article

#go #article
Please open Telegram to view this post
VIEW IN TELEGRAM
1๐Ÿ‘64๐Ÿ†’1
Writing a Circuit Breaker in Go ๐Ÿคก

When you require a method to halt the repeated attempts of a failing operation, a circuit breaker offers an elegant solution to identify failures and facilitate recovery by implementing a cooldown period.

Link to the article

#go #article
Please open Telegram to view this post
VIEW IN TELEGRAM
27๐Ÿ‘1๐Ÿ‘พ1
Using Go Embed โค๏ธ

The go:embed feature simplifies the inclusion of static assets in your Go applications. By embedding files and directories at compile time, you can create more portable and self-contained binaries.

Link to the article

#go #article
Please open Telegram to view this post
VIEW IN TELEGRAM
1๐Ÿ‘53
Try HTML components in pure Go ๐Ÿคก

gomponents are HTML components in pure Go. They render to HTML 5, and make it easy for you to build reusable components. So you can focus on building your app instead of learning yet another templating language.

Link to the component

#go #article
Please open Telegram to view this post
VIEW IN TELEGRAM
14๐Ÿ‘2๐Ÿ†’1
Optimising and Visualising Go Tests Parallelism: Why more cores don't speed up your Go tests โค๏ธ

This article discusses optimizing parallelism in Go tests, focusing on how Goโ€™s t.Parallel() method can improve test performance by allowing certain tests to run concurrently. It also explains why adding more CPU cores doesnโ€™t always speed up tests and introduces a custom tool for visualizing test execution.

Link to the article

#go #article #tests
Please open Telegram to view this post
VIEW IN TELEGRAM
2๐Ÿ”ฅ73โค1