courses / go / level 1

level 1 · easy

go for
beginners.

Start from zero and write real Go programs that talk, remember, decide, repeat and keep lists.

  • 28 lessons
  • 7 units
  • 3 h 29 m in all
  • £0, for good

what’s inside.

For people who have never written a line of code. Nothing is assumed: every new word is explained the moment it appears.

Twenty-eight short lessons take you from your very first line of Go to programs with loops, slices, functions and structs. Each lesson explains one idea with everyday pictures, then has you guess, try and fix real code. You finish by building a funfair token counter that puts everything together.

every lesson goes the same way.

  1. meet it
  2. guess first
  3. your turn
  4. fix it
  5. nailed it

unit 1

Say hello

Make the computer do exactly what you tell it.

4 lessons · 27 min

  1. What code really is5 minFind out what code is and run your very first Go program.
  2. Your first line7 minMeet the frame every Go program needs, then show any message you like.
  3. More than one line7 minShow several lines, blank lines and lots of words at once.
  4. When it goes wrong8 minRead error messages and fix the ones you will see most.

unit 2

Boxes with names

Make the computer remember things.

4 lessons · 30 min

  1. A variable is a labelled box7 minStore a value under a name and use it again.
  2. Boxes can change8 minSwap what is in a box and stick strings together.
  3. Good names, bad names7 minPick names Go accepts and people understand.
  4. Asking a question8 minMake your program wait for an answer and use it.

unit 3

Words and numbers

Tell text and numbers apart and use both.

4 lessons · 30 min

  1. Text and numbers7 minTell Go whether a value is text, a number or a yes-or-no.
  2. Doing maths8 minAdd, take away, multiply, divide and share things out.
  3. Tricks with text7 minMeasure, shout, tidy and swap the words in a string.
  4. Putting values inside text8 minSlot values into sentences and turn numbers into text.

unit 4

Make decisions

Make your program choose what to do.

4 lessons · 30 min

  1. If this, do that8 minMake your program do something only when it should.
  2. Otherwise…6 minGive your program a plan B for when the answer is no.
  3. More than two choices8 minCheck one thing after another and pick the right path.
  4. And, or, not8 minLink conditions together to ask smarter questions.

unit 5

Repeat yourself

Do the same thing many times without copying.

4 lessons · 30 min

  1. Counting with for7 minRepeat lines a set number of times without copying them.
  2. Repeating while it is true8 minKeep going until something changes, however long it takes.
  3. Loops that decide8 minCheck every round, spot even numbers and count matches.
  4. Stopping early7 minLeave a loop early or skip a round you do not need.

unit 6

Slices

Keep many things together and work through them.

4 lessons · 31 min

  1. Making a slice6 minKeep lots of values together in one box.
  2. Reading and changing items9 minGrab, swap and add items in a slice.
  3. Looping over a slice8 minVisit every item in a slice and add things up.
  4. Searching a slice8 minFind out whether something is there and spot the biggest.

unit 7

Your own commands

Wrap code up so you can use it again.

4 lessons · 31 min

  1. Making a function7 minWrap lines of code under one name and run them whenever you like.
  2. Giving it information7 minHand your function a value so it can do something new each time.
  3. Getting an answer back8 minMake a function hand you a result you can keep and use.
  4. Putting it all together9 minBundle values into a struct and build a program from small parts.
end of level 1 level check: a funfair token counter Build one small project with everything from this level. Pass it and your face levels up. see the check

next, level 2

intermediate
go.

Build useful Go programs with maps, methods, interfaces, errors, files, JSON and web handlers.

see level 2