We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Project Setup

To kick things off, let's get our Go project started with a classic "Hello, World!" program.

Tools You'll Need

  1. A code editor. I use Zed, though you can use whatever you're comfortable with.
  2. A command line environment. I work on macOS/Linux, so my instructions will be in Bash. I recommend WSL 2 if you're on Windows so you can still use Linux commands.
  3. The Go toolchain with version 1.22 or higher.
  4. The Boot.dev CLI to run the tests. Install it following the instructions in the README on GitHub, then run bootdev login to authenticate.

The lessons in this course require at least version 1.22 of Go. If you're using an older version, you'll run into some frustrating issues!

GitHub

I highly recommend that you create a git repository for Chirpy hosted on GitHub (or whichever host you prefer), then clone the repo down onto your local machine. It's not a requirement, but a best practice. Use Git to save your work as you go.

Go Modules

A Go module groups the code in your project and tracks the dependencies it uses. The go mod init command creates the module's go.mod file.

The init command needs a module path. For example, if you created a repository at https://github.com/wagslane/chirpy, you would use the path github.com/wagslane/chirpy.

Assignment

Set up a runnable Go project.

  1. go mod init MODULE_PATH
    
  2. go build -o out && ./out
    

Run and submit the CLI tests from the project root.