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

Golang Setup

Let's just get our Go project set up and running. We'll start with a simple "Hello, World!" program.

Assignment

go mod init MODULE_NAME

I recommend naming the module by its remote Git location (you should store all your projects in Git!). For example, my GitHub name is wagslane so my module name might be github.com/wagslane/crawler.

go build -o crawler
./crawler

You should see "Hello, World!" printed to the console.

Submit the CLI tests from your project's root. There's no penalty on failure for this lesson.

Tip

Using go build and ./crawler is a bit cumbersome. Building is best for production code, because it means the person running your program doesn't need to have Go installed.

However, for development, you can use go run . to compile and run your program in one step.