This repository contains a series of challenges to learn Go in an incremental way. Each challenge will introduce new concepts such as struct, testing, data persistence, etc. Furthermore, each challenge will be built on top of the previous ones, so it is not recommended to try Challenge #2 without completing Challenge #1.
By the end of this series of challenges, we will have a minimal project that will expose a REST API, persist data in a database and consume some domain events from Kafka in a docker environment.
Disclaimer: This is not intended to teach Go, but to allow us, developers, to have a safe pet project in which we can validate and put into practice our learnings regarding Go and its ecosystem. So look at this repository as a coding dojo 🥷.
To take a look at other resources to learn go, please go to: https://confluence.mpi-internal.com/display/LHP/Backend+onboarding+resources
As it was mentioned earlier, here you can find a series of incremental challenges to practice coding with Go and its
ecosystem.
We consider challenges 1-4 to be mandatory for a basic understanding, challenges 5-6 to be highly recommended and the rest to be nice to do if time allows.
In the challenges
directory you can find a complete list of the challenges and their instructions. At the
moment the available challenges are:
We are going to work on how Go handles visibility by creating our first module and packages. Furthermore, we will define our first structs and data structures (arrays, maps and slices).
Let's practice error handling. Then we are going to add the first test suites to validate the pieces of code which we have been working on until now.
In this third challenge we are going to create our first HTTP API with Gin and validate it with some fresh new contract tests.
Let's use go routines to see if the ad was also posted on other platforms
In this fifth challenge we will deal with goroutines to solve a simple problem.
In this sixth challenge we are going to deal with Kafka's consumers and producers using the third-party library
shopify/sarama
Let's add some integration tests for what we implemented!
In this challenge, we'll use the TDD approach in order to delete an add
Let's take a look back and see where's room for improvements
To start with this series of challenges, the minimal requirements are:
The way to go with these challenges is by forking this repository and working in your own version of the repository. This way, all of us can have tons of solutions to learn from!
Follow instructions from https://go.dev/doc/install.
On macOS, if you are currently using Homebrew is even easier, just type in your terminal:
brew install go
-
For Visual Studio follow these instructions
-
For IntelliJ just install this plugin.
Furthermore, JetBrains has its own IDE for Go: GoLand. However, if you are already familiar with IntelliJ, the recommendation should be to continue with IntelliJ.
Most of the time, there will be different ways of solving a challenge, the purpose of this repository is double: to practice with Go's ecosystem and to set up interesting discussions between us, so we encourage you to share your solutions or your doubts with the community (at slack: #lbc-backend-guild) to learn from each other ❤️
That's all! You are completely ready to dive into the first challenge 🚀