

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 2
click for more info
Not enough gems
Cost: 6 gems
1: Welcome
incomplete
2: Golang Setup
incomplete
3: Normalize URLs
incomplete
4: Extract Page Content
incomplete
5: Extract Links and Images
incomplete
6: Structure Page Data
incomplete
This lesson's interactive features are locked, please to keep using them
Let's just get our Go project set up and running. We'll start with a simple "Hello, World!" program.
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.
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.