golings

module
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 14, 2024 License: Apache-2.0

README

golings

build and test

gopher

rustlings but for golang this time

You may know 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

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

There are two ways to install golings

go install
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).

Binaries

Go to the releases page and choose the option that best fits your environment.

Web version (playground)

@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.

DevContainer
  1. Install Docker/Podman & VSCode & Configure
  2. Clone the repository and open it in VSCode.
  3. 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.
  4. 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:

git clone git@github.com:mauricioabreu/golings.git

To run the exercises in the recommended order while taking advantage of fast feedback loop, use the watch command:

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:

golings run next

If you want to run a single exercise:

golings run variables1

In case you are stuck and need a hint:

golings hint variables1

To list all exercise while checking your progress:

golings list

To compile and run all the exercises:

golings verify

If you need help with CLI commands:

golings --help

A demo running the command golings run <exercise name>

demo

Contributing

See CONTRIBUTING.md

Learning resources

Other 'lings

Directories

Path Synopsis
exercises
I AM NOT DONE
I AM NOT DONE
I AM NOT DONE
arrays/arrays2 command
I AM NOT DONE
I AM NOT DONE
functions/functions1 command
I AM NOT DONE
I AM NOT DONE
functions/functions2 command
I AM NOT DONE
I AM NOT DONE
functions/functions3 command
I AM NOT DONE
I AM NOT DONE
functions/functions4 command
I AM NOT DONE
I AM NOT DONE
generics/generics1 command
I AM NOT DONE
I AM NOT DONE
generics/generics2 command
I AM NOT DONE
I AM NOT DONE
primitive_types/primitive_types1 command
I AM NOT DONE
I AM NOT DONE
primitive_types/primitive_types2 command
I AM NOT DONE
I AM NOT DONE
primitive_types/primitive_types3 command
I AM NOT DONE
I AM NOT DONE
primitive_types/primitive_types5 command
I AM NOT DONE
I AM NOT DONE
slices/slices3 command
I AM NOT DONE
I AM NOT DONE
structs/structs1 command
structs1 Make me compile!
structs1 Make me compile!
structs/structs2 command
structs2 Make me compile!
structs2 Make me compile!
structs/structs3 command
structs3 Make me compile!
structs3 Make me compile!
switch/switch1 command
I AM NOT DONE
I AM NOT DONE
variables/variables2 command
I AM NOT DONE
I AM NOT DONE
variables/variables4 command
I AM NOT DONE
I AM NOT DONE
variables/variables5 command
I AM NOT DONE
I AM NOT DONE
variables/variables6 command
I AM NOT DONE
I AM NOT DONE
cmd
fixtures/error1 command
nolint success1 Make me compile!
nolint success1 Make me compile!
fixtures/next/next1 command
next1 Make me compile!
next1 Make me compile!
fixtures/next/next2 command
I AM NOT DONE
I AM NOT DONE
fixtures/pending1 command
I AM NOT DONE
I AM NOT DONE
fixtures/success1 command
success1 Make me compile!
success1 Make me compile!
ui

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL