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

#go #golang #concurrency #postgres #database #db
Download Telegram
βœ… First impressions of Go 1.23's range-over-func feature

This article gives a casual look at Go 1.23's new feature where you can use the range keyword to iterate over functions. The author talks about their initial doubts, the learning curve, and what it was like to add this feature to an open-source project.

Link to the article

#go #article
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘4πŸ”₯3
βœ… What's the best Static Analysis tool for Golang?

Looking to level up your Go code quality? Check out this article for a comparison of the most popular static code analysis tools in Go. Find the perfect tool to catch bugs early and write cleaner code. πŸš€

Link to the article

#go #article
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘3πŸ‘Ύ3❀1😍1
βœ… GopherCon Europe 2024: Rethinking Domain-Driven Design in Go

The GopherCon Europe conference recently featured insightful presentations, including a compelling talk by Robert Laszczak, co-author of "Go with Domains." His presentation, "Rethinking Domain-Driven Design in Go," explored how DDD can be effectively applied in Go to build reliable and scalable applications.

https://www.youtube.com/watch?v=FBOzPJkedcw

#go #video
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ”₯3πŸ‘2
βœ… Iterators in Go

This article explains how to implement and use iterators in Go. It covers the benefits of iterators over traditional slices, such as reduced memory usage and improved efficiency, by yielding one result at a time.

Link to the article

#go #article #iterators
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘4πŸ”₯3
βœ… GopherCon Europe 2024: Memory Optimization through Structure Packaging

Another interesting report from the recent GopherCon Europe 2024 conference was presented by DataDog engineer Diana Shevchenko, titled "Memory Optimization through Structure Packaging." In her report, Diana discusses how the proper use of structures can enhance the performance of an entire application.

https://www.youtube.com/watch?v=HPc-C0bx3kg

#go #video
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ”₯3πŸ‘2πŸ‘1
βœ… 5 small tips I recently learned in Go

No matter how long you’ve been programming in your favorite language, you still find new small bits that rub you in a pleasant way.
Here are 5 small tips I recently learned in Go that I didn’t know existed.


Link to the article

#go #article
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘7πŸ”₯3
βœ… Build Your Own SMTP Server in Go

By building an outbound SMTP server from scratch, you can gain a level of insight into email delivery that most developers never achieve.

To proceed, we are going to use the Go programming language, along with the awesome mail librairies from Simon Ser. We'll demystify the process, show you how to send emails to other servers, and even explain key concepts like SPF, DKIM, and DMARC allowing for deliverability.


Link to the article

#go #article
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘5πŸ”₯4❀1
βœ… Learn Go with Tests: A Refactoring Checklist

The popular Learn Go with Tests guide gains a new chapter that gets you thinking about refactoring, when it makes sense to do it, and some of the basic techniques.

Link to the article

#go #article
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘5πŸ”₯5
❀️ A 10 Week Go Backend Engineer Onboarding Plan

Stream has published the onboarding program they use for Go developers, which covers the basics of Go, databases, HTTP, and more. This is a great idea and sets expectations if you’re looking for work.

Link

#go
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘3πŸ”₯3πŸ₯°2❀1
βš™οΈ go-sqlbuilder - simple and powerful sql query builder

The sqlbuilder package implements a series of flexible and powerful SQL string concatenation builders. This package focuses on constructing SQL strings for direct use with the Go standard library's sql.DB and sql.Stmt related interfaces, and strives to optimize the performance of building SQL and reduce memory consumption.

https://github.com/huandu/go-sqlbuilder

#go #tool
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ”₯5πŸ‘3
❀️ Go structs are copied on assignment (and other things about Go I'd missed)

I thought I more or less understood the basics of the language, but this week I’ve been writing a lot more Go than usual while working on some upgrades to Mess with DNS, and ran into a bug that revealed I was missing a very basic concept!

I found a couple of other misconceptions I had about Go. I’ll talk about some of the mistakes that jumped out to me the most.


Ling to the article

#go #article
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘3❀2πŸ”₯1
❀️ Vendoring, or go mod vendor: What Is It?

This article provides a comprehensive guide on using Go's go mod vendor command, explaining how it helps manage dependencies by copying them into your project’s vendor directory. It also discusses the benefits of vendoring, including ensuring reproducible builds and enhancing security by locking down dependencies.

Link to the article

#go #article
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘6❀1
πŸ§™Go 1.23 Release

The biggest update is the introduction of iterators. The slices and maps packages have been enhanced with new methods for working with iterators. For example, Chunk() method from the slices package allows you to iterate over a slice in batches of a specified number of elements:
 people := People{
{"Gopher", 13},
{"Alice", 20},
{"Bob", 5},
{"Vera", 24},
{"Zac", 15},
}

// Chunk people into []Person 2 elements at a time.
for c := range slices.Chunk(people, 2) {
fmt.Println(c)
}
Additionally, on the optimization front, PGO has been further enhanced, as we mentioned here, here and here. Thanks to more efficient stack usage, these optimizations can now provide a few extra percentage points of resource savings and performance improvements at no cost.
Please open Telegram to view this post
VIEW IN TELEGRAM
❀6πŸ‘6πŸ”₯6
πŸ‘ΎGolang Defer: From Basic To Traps

The defer statement is probably one of the first things we find pretty interesting when we start learning Go, right?


Link to the article

#go #article
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘4πŸ”₯4❀1
πŸ‘ΎAn unordered list of things I miss in Go

A solid list with some doable and not-so-doable items. On the doable side, there are ordered maps and default arguments. On the not-so-doable, null/nilability is a long-time contentious subject that likely would break backward compatibility.

Link to the article

#go #article
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ”₯4πŸ‘2
❀️ Range Over Function Types

Range over function types is a new language feature in the Go 1.23 release. This blog post will explain why we are adding this new feature, what exactly it is, and how to use it.

https://go.dev/blog/range-functions

#go #articlego
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘3πŸ”₯3
❀️ GopherCon UK: Debugging Go Applications - Matt Boyle, Cloudflare

GopherCon UK just concluded, featuring a host of excellent talks. Today, we’re spotlighting Matt Boyle’s presentation on Debugging Go Applications:

In this talk, I will perform a live demo of different debugging techniques that Go developers can use to figure out why their application is not performing optimally (or even correctly).

We will start with a basic Go application that isn't functioning as expected. By introducing logs, using the debugger, adding some Prometheus metrics, adding pprof, and integrating distributed tracing, we demonstrate some of the powerful techniques available to diagnose and repair applications, not only while they're running locally but also when they're deployed in production!

Along the way, I'll share stories about how these specific techniques have been scaled to help me solve complex issues at Cloudflare scale, as well as provide warnings on when to use these techniques sparingly (for example, the cardinality of Prometheus metrics).


https://www.youtube.com/watch?v=7YfFBTkGIOI

#go #video #gophercon #gopherconuk
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ”₯3πŸ‘22
πŸ€“ New unique package

The article on the Go blog introduces the unique package in Go 1.23, which helps optimize memory usage by deduplicating comparable values. It offers efficient value comparison and better memory management through the new Handle[T] type.

https://go.dev/blog/unique

#go #article #v1_23
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘533
7 Concurrency Patterns in Go You Should Know 🐹

Concurrency is one of Go’s most powerful features, and mastering it is crucial to building scalable and efficient applications. Here are 7 concurrency patterns in Go that you should know about.

Link to the article

#go #article
6πŸ‘3❀1
πŸ€“ How to write a programming language and shell in Go with 92% test coverage and instant CI/CD-Qi Xiao

We also present you with another excellent report from the recent GopherCon UK conference.

In this talk I will share my experience of developing a programming language and shell (Elvish, https://elv.sh) in Go.


https://www.youtube.com/watch?v=YzIiUjgnSsA

#go #video #gopherconuk
Please open Telegram to view this post
VIEW IN TELEGRAM
✍422