Course outline
Course / The terminal and the language

Read the error, fix the line

Lab

How to fetch and submit this lab

Once: install the tool and connect your account.

curl -fsSL https://gonomicon.com/install.sh | sh
gonomicon login

Each lab: download it, edit the file named in the instructions, then submit.

gonomicon fetch week-1/07-04-fix-the-compiler-error
cd 07-04-fix-the-compiler-error
gonomicon submit

Go installed? gonomicon test runs the visible test on your computer first. Submitting also runs hidden checks on our server.

Goal

This program doesn't compile. That's on purpose — your job is to read the compiler's error message, find the mistake it's pointing at, and fix it.

What you'll see

Run:

go build .

You'll get a real compiler error. Read it left to right: the file, the line and column, then what the compiler couldn't find. Look at the line it points to and compare the name there against the fmt functions you already know.

Your job

Fix the one broken line so the program compiles and prints exactly:

Compiler errors tell you exactly where to look: file, line, column, then what's wrong.

Where to write it

Edit main.go. Only one line needs to change — don't rewrite the rest.

Checking your work

go build .
go run .
go test ./...

If go build . still complains, read the new message the same way: file, line, column, then what's wrong.

Run it

gonomicon fetch week-1/07-04-fix-the-compiler-error
cd 07-04-fix-the-compiler-error
gonomicon test
gonomicon submit

Hints

  1. The error names a file, a line, and a column, then says what it couldn't find — read it left to right.
  2. Compare the misspelled call against the fmt functions you already know, letter by letter.
  3. Only one line needs to change. Everything else in the file is already correct.

Something wrong with this lesson? Report a problem