• Stars
    star
    632
  • Rank 71,124 (Top 2 %)
  • Language
    Go
  • License
    MIT License
  • Created over 2 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

📘️ Learn Go by fixing tiny incorrect programs

gopherlings

📘️ Learn Go by fixing tiny incorrect programs

This project was directly inspired by the great ziglings project which itself was inspired by rustlings.

For a first time learner it is suggested you complement this material with another source such as

Intended Audience

These exercises will probably be difficult if you've never programmed before.

The exercises should be self-contained and self-explained, though this is a WIP and suggestions are welcome!

Instructions: Running exercises

Requires a Go installation to run the examples.

Instructions using VSCode

  1. Download the repository (or alternatively clone it)

  2. Install the VSCode Go extension authored by Go Team at Google

  3. Open the gopherlings folder in VSCode

  4. Navigate to the exercise file, i.e. exercises/001-hello/hello.go

  5. Once the hello.go file is open you may edit it and press F5 to run it. Output will be shown in the Debug Console.

Instructions using terminal

  1. Clone repository

    git clone https://github.com/soypat/gopherlings.git 
  2. Navigate to example's directory

    cd gopherlings/exercises/001-hello
  3. Edit the file so it is correct and run it with go run

    go run hello.go

    Optionally, instead of step 3, use gopherlings watch to auto reload your code after you save your code. Then you will see your code output without any action. You can simply focus on your code.

    go install github.com/soypat/gopherlings/cmd/gopherlings@latest
    gopherlings watch
    gopherlings help  # To see other commands

Roadmap

Short term

  • Add quizzes after $n$ exercises.
    • Possibly add several quizzes of varying difficulty inside quiz directory.
  • Improve the helper program.
    • A hint subcommand or interactive hints during the watch command.
    • Allow run to take an argument that runs a specific exercise.
    • Add a subcommand to run all exercises and check them against expected output.
    • Catch errors that prevent the helper from running exercises (like an incomplete Go installation).

Long term

  • Have exercises that cover the entire Go spec.

More Repositories

1

cyw43439

Driver for the Wifi+bluetooth integrated circuit on the pico.
Go
112
star
2

mu8

Genetic algorithm for unsupervised machine learning in Go.
Go
109
star
3

sdf

A Go library for signed distance function shape generation. Read as 3D printing shape design.
Go
92
star
4

gitaligned

Find out where you fall on the Open-Source Character Alignment Chart
Go
74
star
5

natiu-mqtt

A dead-simple, extensible MQTT implementation well suited for embedded systems.
Go
58
star
6

go-maquina

Small finite-state machine library for Go
Go
41
star
7

peasocket

little websocket implementation
Go
34
star
8

go-presentx

golang's present tool but with code syntax highlighting
CSS
33
star
9

rebed

Recreates directory and files from embedded filesystem using Go 1.16 embed.FS type.
Go
23
star
10

godesim

ODE system solver made simple. For IVPs (initial value problems).
Go
21
star
11

exif

Dead simple exchangeable image file format tools for Go optimized for large image files using lazy loading.
Go
18
star
12

tiny-ahrsim

TinyGo attitude estimation simulation applet.
Go
17
star
13

threejs-golang-example

THREE.js example of rotating cube using gopherjs bindings. 160 lines of Go code.
JavaScript
14
star
14

sdf3ui

Browser based 3D model visualizer for use with soypat/sdf package.
Go
12
star
15

glgl

OpenGL bindings for Go that are in the goldilocks level of abstraction zone.
Go
12
star
16

three

syscall/js bindings for three.js in-browser 3D graphics.
Go
10
star
17

neurus

Neural network minimal working example in Go fit for teaching.
Go
10
star
18

ether-swtch

Low level Ethernet stack marshaller/unmarshaller for use in tiny places.
Go
8
star
19

natiu-wsocket

MQTT websocket implementation using natiu-mqtt.
Go
6
star
20

lap

linear algebra package. like gonum/mat, but small. lets say gonum-lite
Go
5
star
21

goldmark-latex

A LaTeX renderer for Goldmark. Produce .tex files from markdown.
Go
5
star
22

ieeeztreme14

IEEExtreme 14.0 solved problems for team finally_cflat
Go
4
star
23

go-play3d

3D math playground for Go.
Go
4
star
24

sv

idiomatic go http server
Go
3
star
25

gwasm

Common utilities I find myself rewriting too often across Go WASM projects.
Go
3
star
26

peamodbus

Fault tolerant, TCP modbus implementation in Go that just works. Apt for embedded systems.
Go
3
star
27

tinygo-arduino-examples

Compilation of LCD screen, ADC, and output examples.
Go
2
star
28

go-canard

Go port of libcanard. WIP.
Go
2
star
29

decimate

csv file decimator/downsampler for reducing number of points of a curve or signal.
Go
2
star
30

manigold

3D Mesh creation, manipulation and optimization library.
Go
2
star
31

go-mod-tricks

go.mod file and `go mod` command tricks to make using modules a breeze.
2
star
32

mdc

Material Design Components for use with Vecty in the most minimalistic fashion.
Go
2
star
33

plot3

3D line plots in pure Go
Go
2
star
34

whittileaks

Hardcore class notes for mechanical engineering.
TeX
2
star
35

decaffeinator

An effort to relieve the establishment of caffeine.
Go
1
star
36

piaa

Industrial extension board for Raspberry Pi Pico (W). RS485, EMI insulated digital input/output pins.
1
star
37

so

MWE tutorial of .so dynamic linking in C and Go.
C
1
star
38

tiny-sproto

A simple Point-to-Point Protocol implementation written in Go.
Go
1
star
39

wchart

syscall/js bindings for Chart.js
Go
1
star
40

novatex

Guía del LaTeX para principiantes
TeX
1
star
41

go-fem

Go packages for finite element analysis/methods.
Go
1
star
42

net

Temporary repo for minimal net package from go std lib for use with tinygo until v0.18.0 released
Go
1
star
43

fea-two

Elementos Finitos II @ ITBA
MATLAB
1
star
44

combinatrix

Combinar horarios para ITBA """dinamicamente"""
Go
1
star
45

go-qap

CERN's quality assurance plan (QAP) to solve the document naming convention problem.
Go
1
star
46

shaders

Wai- wha? Shaders? Like GPU stuff? Yeah, gpu stuff.
Go
1
star
47

vecty-examples

Basic usage of Vecty framework examples.
Go
1
star
48

go-proy

Proyectos para practicar golang
Go
1
star
49

seqs

seqs: the hottest, most idiomatic TCP implementation on the internet.
Go
1
star