base on rustlings but for golang this time # golings
[![build and test](https://github.com/mauricioabreu/golings/actions/workflows/test.yml/badge.svg)](https://github.com/mauricioabreu/golings/actions/workflows/test.yml)
![gopher](misc/gopher-dance.gif)
> rustlings but for golang this time
You may know [rustlings](https://github.com/rust-lang/rustlings), right? If you don't, please go ahead and check out.
`rustlings` is awesome. It is a CLI app designed to teach the awesome Rust programming language through exercises.
`golings` has the very same idea, but for the [Go programming language](https://go.dev/)
After setting up all the tools required to run `golings` you have the task to fix tiny go programs.
## Installing
First, you need to have `go` installed. You can install it by visiting the [Go downloads page](https://go.dev/dl/)
There are several ways to install `golings`
### Option 1: GO install
```sh
go install github.com/mauricioabreu/golings/golings@latest
```
Add `go/bin` to your PATH if you want to run golings anywhere in your terminal. From the official docs:
> The install directory is controlled by the GOPATH and GOBIN environment variables. If GOBIN is set, binaries are installed to that directory. If GOPATH is set, binaries are installed to the bin subdirectory of the first directory in the GOPATH list. Otherwise, binaries are installed to the bin subdirectory of the default GOPATH ($HOME/go or %USERPROFILE%\go).
#### Windows installation
Some tests depend on `CGO` which is not installed by default.
1. Install scoop package manager [Scoop Homepage](https://scoop.sh)
```powershell
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression
```
1. Install MINGW using scoop
```powershell
scoop install mingw
```
1. Close the Powershell session
### Option 2: Binaries
Go to the [releases page](https://github.com/mauricioabreu/golings/releases) and choose the option that best fits your environment.
### Option 3: Web version (playground)
[@Grubba27](https://github.com/Grubba27/) worked hard to create a web version: https://golings.vercel.app/
It's pretty awesome and uses the playground so you can play with the exercises without installing anything.
### Option 4: DevContainer
1. Install Docker/Podman & VSCode & Configure
1. Clone the repository and open it in VSCode.
1. You will be prompted to reopen the code in a devcontainer. The container is pre-configured with go and all of the tools needed to debug go code.
1. Open a new embeded terminal and run `golings watch` to start the exercises.
## Doing exercises
All the exercises can be found in the directory `golings/exercises/<topic>`. For every topic there is an additional README file with some resources to get you started on the topic. We really recommend that you have a look at them before you start.
Now you have the task to fix all the programs. Some of them don't compile, and you need to fix them. Some of them compile, but have tests and you need to write some code to have them all green (these are the `compile` and `test` modes).
Clone the repository:
```sh
git clone
[email protected]:mauricioabreu/golings.git
```
To run the exercises in the recommended order while taking advantage of fast feedback loop, use the _watch_ command:
```sh
golings watch
```
For Windows:
```powershell
$env:CGO_ENABLED=1
golings watch
```
This command will run golings in interactive mode. Every time you save a file it will verify if the code is correct.
To run the next pending exercise:
```sh
golings run next
```
If you want to run a single exercise:
```sh
golings run variables1
```
In case you are stuck and need a hint:
```sh
golings hint variables1
```
To list all exercise while checking your progress:
```sh
golings list
```
To compile and run all the exercises:
```sh
golings verify
```
If you need help with CLI commands:
```sh
golings --help
```
A demo running the command `golings run <exercise name>`
![demo](misc/demo.gif)
## Contributing
See [CONTRIBUTING.md](./CONTRIBUTING.md)
## Learning resources
* [Golang official tutorial](https://go.dev/doc/tutorial/)
* [Go by example](https://gobyexample.com)
* [Aprenda Go](https://www.youtube.com/playlist?list=PLCKpcjBB_VlBsxJ9IseNxFllf-UFEXOdg)
## Other 'lings
* [rustlings](https://github.com/rust-lang/rustlings)
* [ziglings](https://github.com/ratfactor/ziglings)
", Assign "at most 3 tags" to the expected json: {"id":"9943","tags":[]} "only from the tags list I provide: [{"id":77,"name":"3d"},{"id":89,"name":"agent"},{"id":17,"name":"ai"},{"id":54,"name":"algorithm"},{"id":24,"name":"api"},{"id":44,"name":"authentication"},{"id":3,"name":"aws"},{"id":27,"name":"backend"},{"id":60,"name":"benchmark"},{"id":72,"name":"best-practices"},{"id":39,"name":"bitcoin"},{"id":37,"name":"blockchain"},{"id":1,"name":"blog"},{"id":45,"name":"bundler"},{"id":58,"name":"cache"},{"id":21,"name":"chat"},{"id":49,"name":"cicd"},{"id":4,"name":"cli"},{"id":64,"name":"cloud-native"},{"id":48,"name":"cms"},{"id":61,"name":"compiler"},{"id":68,"name":"containerization"},{"id":92,"name":"crm"},{"id":34,"name":"data"},{"id":47,"name":"database"},{"id":8,"name":"declarative-gui "},{"id":9,"name":"deploy-tool"},{"id":53,"name":"desktop-app"},{"id":6,"name":"dev-exp-lib"},{"id":59,"name":"dev-tool"},{"id":13,"name":"ecommerce"},{"id":26,"name":"editor"},{"id":66,"name":"emulator"},{"id":62,"name":"filesystem"},{"id":80,"name":"finance"},{"id":15,"name":"firmware"},{"id":73,"name":"for-fun"},{"id":2,"name":"framework"},{"id":11,"name":"frontend"},{"id":22,"name":"game"},{"id":81,"name":"game-engine "},{"id":23,"name":"graphql"},{"id":84,"name":"gui"},{"id":91,"name":"http"},{"id":5,"name":"http-client"},{"id":51,"name":"iac"},{"id":30,"name":"ide"},{"id":78,"name":"iot"},{"id":40,"name":"json"},{"id":83,"name":"julian"},{"id":38,"name":"k8s"},{"id":31,"name":"language"},{"id":10,"name":"learning-resource"},{"id":33,"name":"lib"},{"id":41,"name":"linter"},{"id":28,"name":"lms"},{"id":16,"name":"logging"},{"id":76,"name":"low-code"},{"id":90,"name":"message-queue"},{"id":42,"name":"mobile-app"},{"id":18,"name":"monitoring"},{"id":36,"name":"networking"},{"id":7,"name":"node-version"},{"id":55,"name":"nosql"},{"id":57,"name":"observability"},{"id":46,"name":"orm"},{"id":52,"name":"os"},{"id":14,"name":"parser"},{"id":74,"name":"react"},{"id":82,"name":"real-time"},{"id":56,"name":"robot"},{"id":65,"name":"runtime"},{"id":32,"name":"sdk"},{"id":71,"name":"search"},{"id":63,"name":"secrets"},{"id":25,"name":"security"},{"id":85,"name":"server"},{"id":86,"name":"serverless"},{"id":70,"name":"storage"},{"id":75,"name":"system-design"},{"id":79,"name":"terminal"},{"id":29,"name":"testing"},{"id":12,"name":"ui"},{"id":50,"name":"ux"},{"id":88,"name":"video"},{"id":20,"name":"web-app"},{"id":35,"name":"web-server"},{"id":43,"name":"webassembly"},{"id":69,"name":"workflow"},{"id":87,"name":"yaml"}]" returns me the "expected json"