No matter if you’re actively making services and projects using GoLang, or like me have been under a rock for over a year, we gotta admit; GoLang’s community is at least as fast as the language.
Every once in a while, I put all the GitHub repositories and websites I can get my eyes on, on the table; just to find out what’s coming or what has changed. It’s useful to see new practices, new learning materials and even nicely done libraries and utilities.
In this post, I wanna share the goodies I’ve been watching that would help to make a better GoLang project in 2024. Gotta catch the community as well as the language, or you’d see a gopher in your dreams saying: “Gotcha! 😂”
Table of contents
Open Table of contents
Learning the ropes
To get started with Go, one must first learn the syntax and the lean towards thinkg in a functional Go like manner.
Starting points
- Go by Example is the best point to start learning the syntax. Keep in mind there’s syntax, language specific concepts like goroiutines & channels, and also standard libraries like files & context & etc.
- Golang Cheat Sheet is very nice for reviewing what you learned or would work with quickly.
- 100 Go Mistakes is a good read to avoid mistakes that might seem new but are actually very common.
- Go 101 has a good set of content to understand the different parts better. You should also try the quizes section to learn by problem solving.
- Go Interview has a good set of questions/answers. Usually technical interview questions are designed to test you in a short time. I’d say you should try solving something first and then look at the answer.
- Go Patterns is an old repository. It’s a good show case of how different design patterns look in Go, but you can’t see any interface or generic throughout the code. It’s a good inspiration repository.
You usually need to learn different problem solvings for algorithmic questions. The pure algorithmic questions are usually used in interviews, but on a day to day basis you need to know about them to create better technical solutions and architectures. Here’s some places to check out related problems/solutions in Go: LeetCode Cookbook (use google translate 😅)
Toward some fluency
You can’t learn everything all at once. But you can dive deeper when needed if you know where to look at. Now where to look at?
- Go Official Blog When new things are coming here’s where you can find it first. Everything isn’t necessarily easy to read but you need to learn that any way.
- Gopher Reading List is an always work in progress list. You eventually read and learn most of the stuff and you should look for what you need at the moment each time you check it out.
- Keep in mind the [Gopher’s Slack] supported by GoBridge
Deep into the language
As we get deeper into GoLang, things start to make sense more; However, things also start to go Chinese! This doesn’t mean there isn’t any English equivalant, but the open-source/free ones are still Chinese. After using translation a little bit you would see for yourself why I’m bringign in the Chinese resources.
But let’s start with the obvious and English ones!
Respect the style
- Effective Go has been a consistent place to be up to speed with coding and development style. You would learn most of it by practice, but good to read it at least once.
- Google Go Style is part of Google’s Coding Styles. You should defenitely read the Style Guide, but for best practices and style decisions it could be read along the way.
- Uber Go Guide might even be available in your own native language. This start to play differently when serving real-time apps to massive user bases. These rules usually are played inside companies and it’s a good place to look for ideas and inspirations as well as reasoning for different decisions.
Know how things work
Now there is Golang Design to look out for in the upcoming years. It’s getting really good. For a consistent source of discussions and juicy interview questions check out Study Golang.
Wanna learn even more?
- Standard Library by Example is a good place to see how things should work. Or even what tools you have out-of-the-box with Go!
- Go Interview Questions goes deep into different concepts and the language itself. As a senior go developer, you should know these to know the playground you’re playing. (open-srouce and part of golang design)
- Advanced Programming in Go is good to understand GoLang’s use cases and common practices in distributed systems.
- Customizing Golang Guide is good if you wanna delve deep into the language and its syntax tree.
- is Go2 coming? it’s a spicy topic. If it does, the first learning sources are in Chinese! ;)
Tools of the day or tomorrow’s!
Project essentials
- Go Clean Template is more of an example of how a project should be structured. You should also look into popular Go repostories to understand these stuff better, yet this is a good starting point.
- Testify seems essential for enhancing testing utils.
- It provides mocking and test suit utilities.
- If you need to create mocks based on your business logic from some file, take a look into Mockery.
- Ginko is another popular testing framework.
- GoTests helps with generating tests, but I haven’t tried it myself. Let me know if you had a better understanding of this! (cause I’m curious of it’s comparison with recent LLMs)
- Linting is essential to avoid making basic mistakes. GoLang CI Lint is widely used. There’s also Revive coming up; It’s faster and allows writing new linters easily. (use with caution)
- Copying can get complicated in go. Avoid writing your own deep copier. Copier could be useful in these cases.
- Viper is almost an standard for having configs. If you need dynamic config changes you’ll need to use some mutex, channels mixed with fsnotify. If you need to be case sensitive with some values, mapstructure might be handy. Check out mocker’s config code to understand better.
- Cobra is your go to tool for making CLI apps. We can say every app is a CLI app, but you might not need to use it in every place.
- DB Migration inside your project? Use Goose or migrate.
- Logging is more complicated than it might seem on the surface. Logrus makes it easy to use in the app and have integrations like Sentry. But too much logging can cause performance concerns. Then you should check zap or zerolog. Slog is another logger worth checking out!
- JSON Parsing is something that happens a lot! The standard library already supports it, but it’s not performant and efficient. Check JSONiter for a drop-in replacement of the standard library one. I’ve also used gjson for the same goal, tidwall has some good repos with similar context.
- task is new thing we use instead of Makefile. You can see its examples and use cases in popular projects.
- GoReleaser is something essentials, specially if you’re delivering the app to multiple CPU architectures.
Might need them at some point
- Got some cronjobs or tasks that you need to manage? Temporal is the way to go.
- It’s in Go but can use other languages to write tasks.
- If you have a PHP project that needs to couple with Go services, try RoadRunner
- Resty is handy when you need to create solid integrations with REST APIs.
- Authentication and Authorization has a lot of grounds to cover. But these might be handy:
- You usually won’t see these first hand, but in addition to Go Tools, Delve is your day to day debugger (usually in the IDE). GoCallvis could come in handy.
- Wails makes it easy to create desktop apps with web frontend and go backend in the app.
- Also check out another good source for tools of Go. Thinking of looking for more? Then you gotta go for Awesome Go
What we missed here?
The path to finding resources to be a better engineer is not limited. There are tons of stuff I didn’t cover here. Just to point out what to look for:
- You can pay to learn and even get certification of completion at some places.
- There are good books, some GoLang related and some engineering related. (like: Designing Data Intensive Applications)
- You can find a lot of Youtube videos online to see examples, explanations, and more.
- A more related set of videos are different years of GopherCon and GopherCon EU.
- There are some really good talks at InfoQ about scaling up, architecure, soft skills and more.
- If you know Chinese, checkout Talk Go.
- I’m sure you can find more with a little digging.
- For integrations with different technologies and services, you can always use their API; Some of them have SDK supports in Go, too.
- There are new libraries popping up that reimplement old technologies with Go or Rust. I wouldn’t use them for production until they’re proven or stable. But nice to check out and be up to date with them.
- PocketBase is one intersting of a project (specially if you know Supbase); But it deserves its own post.
- There are a lot of infrastructure tools written in Go, Docker as wrapper of LXC is an example. I usually track CNCF Projects for these items.
That’s all for this year. Let’s see how thing play until the next one!