Ten Years of “Go: The Good, the Bad, and the Meh”
Ten years ago, I wrote Go: The Good, the Bad, and the Meh. Way back in 2013, it made it to the front page of Hacker News and got over 400 comments on /r/programming. I don’t have analytics from back then, but I suspect it’s one of my more discussed pieces of writing, and it was definitely one of my first experiences of getting a lot of feedback for my writing. (Then again, I don’t have any evidence of whether John Carmack read it, so maybe it’s not the one for my obituary.)https://blog.carlmjohnson.net/post/2023/ten-years-of-go-good-bad-meh
Anyway, it’s been a decade, and in that time I’ve gone from playing around with Go as an amateur to being a professional programmer and using Go as one of my core languages. So, I thought it would be fun to look back at what I got right, what’s changed since I wrote it, what I missed, and what I got wrong. Feel free to read or re-read the original post, or just stick to my reflections here without digging back into it. Just know that as its title suggests, I wrote it with three sections for what I thought was “good”, “bad”, and “meh” about Go at that time.
Event-Driven Architecture: What You Need to Know
What is an Event-Driven Architecture and Why do I need One?https://encore.dev/blog/event-driven-architecture
oidc
Easy to use OpenID Connect client and server library written for Go and certified by the OpenID Foundationhttps://github.com/zitadel/oidc
Preview: ranging over functions in Go
A major Go language change proposal was published earlier this week: add range over int, range over func, and there's a good chance this change will make it into a future Go release. In this post I will discuss the motivation for this proposal, how it's going to work, and provide some examples of how Go code using it would look.https://eli.thegreenplace.net/2023/preview-ranging-over-functions-in-go
Update 2023.07.24: the proposal keeps evolving, and some details will likely change. This post still serves as a good introduction to the topic, and I will update it (or add another post) when the proposal settles to the final syntax and semantics.
Tutorial: Find and fix vulnerable dependencies with govulncheck
Govulncheck is a low-noise tool that helps you find and fix vulnerable dependencies in your Go projects. It does this by scanning your project’s dependencies for known vulnerabilities and then identifying any direct or indirect calls to those vulnerabilities in your code.https://go.dev/doc/tutorial/govulncheck
In this tutorial, you will learn how to use govulncheck to scan a simple program for vulnerabilities. You will also learn how to prioritize and evaluate vulnerabilities so that you can focus on fixing the most important ones first.
The Go Memory Model
The Go memory model specifies the conditions under which reads of a variable in one goroutine can be guaranteed to observe values produced by writes to the same variable in a different goroutine.https://go.dev/ref/mem
Common pitfalls in Go benchmarking
Go programmers have the good fortune of excellent testing and benchmarking tooling built into the standard library - in the testing package. However, benchmarking is hard. This isn't Go specific; it's just one of those things experienced developers learn over time.https://eli.thegreenplace.net/2023/common-pitfalls-in-go-benchmarking
This post lists some common benchmarking pitfalls Go programmers run into. It assumes basic familiarity with writing Go benchmarks; consult the testing package documentation if needed. While these pitfalls are presented in Go, they exist in any programming language or environment, so the lessons learned here are widely applicable.
Getting Friendly With CPU Caches
https://www.ardanlabs.com/blog/2023/07/getting-friendly-with-cpu-caches.html
https://www.ardanlabs.com/blog/2023/07/getting-friendly-with-cpu-caches.html
Use Cobra to Build Go-Powered CLIs
In this tutorial, I will show how you can use Cobra to build CLI applications in Go and highlight some of its key features and benefits. I will do this by walking you through the process of building a CLI that encrypts and decrypts text based on a specified cipher.https://www.twilio.com/blog/use-cobra-build-go-powered-clis
Golang — это язык, который выбирают IT-инженеры и разработчики. Почему? Приведем пару фактов:
🔥 Это простой и востребованный язык: специалисты отдают предпочтение Go за легкость в работе и за то, что программы на нем исполняются с высокой скоростью.
🔥 Быстрый вход: у Go простой синтаксис и короткая документация. Для начала работы вам не потребуется серьезный технический бэкграунд.
🔥 Работодатели хотят сотрудников со знанием Go: этот язык входит в пятерку самых высокооплачиваемых по данным Хабр Карьера, а также в пятерку самых применяемых на GitHub.
Хотите освоить Golang, создавать с его помощью свои API-серверы? Запускать контейнеры и взаимодействовать с Docker из Go?
Тогда вам подойдёт курс «Golang для инженеров» от Слёрм✨ Он стартует 11 сентября!
Курс будет проходить в формате потока: эксперты будут отвечать на вопросы студентов, проводить встречи с подробным разбором сложных заданий.
К концу обучения вы разработаете систему, которая будет собирать состояние других сервисов, сохранять собранное состояние в базу данных и предоставлять WEB API для доступа к сохраненным данным.
Посмотреть подробную программу можно по этой ссылке⚡
Хотите освоить Golang, создавать с его помощью свои API-серверы? Запускать контейнеры и взаимодействовать с Docker из Go?
Тогда вам подойдёт курс «Golang для инженеров» от Слёрм
Курс будет проходить в формате потока: эксперты будут отвечать на вопросы студентов, проводить встречи с подробным разбором сложных заданий.
К концу обучения вы разработаете систему, которая будет собирать состояние других сервисов, сохранять собранное состояние в базу данных и предоставлять WEB API для доступа к сохраненным данным.
Посмотреть подробную программу можно по этой ссылке
Please open Telegram to view this post
VIEW IN TELEGRAM
From 26 Minutes to 20 Seconds: Using pprof to optimize large GraphQL Operations in Go
https://wundergraph.com/blog/optimizing_large_graphql_operations_with_golangs_pprof_tools
https://wundergraph.com/blog/optimizing_large_graphql_operations_with_golangs_pprof_tools
ff
ff stands for flags-first, and provides an opinionated way to populate a flag.FlagSet with configuration data from the environment. By default, it parses only from the command line, but you can enable parsing from environment variables (lower priority) and/or a configuration file (lowest priority).https://github.com/peterbourgon/ff
Building a commandline application in the style of kubectl or docker? Consider package ffcli, a natural companion to, and extension of, package ff.
Golang Quirks & Tricks
Pt 2: https://eblog.fly.dev/quirks2.html
Pt 3: https://eblog.fly.dev/quirks3.html
Go is generally considered a ‘simple’ language, but it has more edge cases and tricks than most might expect.Pt 1: https://eblog.fly.dev/quirks.html
Pt 2: https://eblog.fly.dev/quirks2.html
Pt 3: https://eblog.fly.dev/quirks3.html
grpcurl
grpcurl is a command-line tool that lets you interact with gRPC servers. It's basically curl for gRPC servers.https://github.com/fullstorydev/grpcurl
How to Build a Globally Distributed, Multi-Region Identity and Access Platform with Go
https://www.ory.sh/global-identity-and-access-management-multi-region
https://www.ory.sh/global-identity-and-access-management-multi-region
Structured Logging with slog
The new log/slog package in Go 1.21 brings structured logging to the standard library. Structured logs use key-value pairs so they can be parsed, filtered, searched, and analyzed quickly and reliably. For servers, logging is an important way for developers to observe the detailed behavior of the system, and often the first place they go to debug it. Logs therefore tend to be voluminous, and the ability to search and filter them quickly is essential.https://go.dev/blog/slog
Advanced Go Concurrency
Learn how to use Go's singleflight and errgroup packages, and other important design patterns for concurrency, with real-world examples.https://encore.dev/blog/advanced-go-concurrency