

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 3
click for more info
Not enough gems
Cost: 6 gems
1: Packages
incomplete
2: Package Naming
incomplete
3: Install
incomplete
4: Modules
incomplete
5: Go Environment
incomplete
6: First Local Program
incomplete
7: Go Run
incomplete
8: Go Build
incomplete
9: Go Install
incomplete
10: Custom Package
incomplete
11: Custom Package Continued
incomplete
12: Remote Packages
incomplete
13: Clean Packages
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
Every Go program is made up of packages.
You have probably noticed the package main at the top of all the programs you have been writing.
A package named "main" has an entry point at the main() function. A main package is compiled into an executable program.
A package by any other name is a "library package". Libraries have no entry point. Libraries simply export functionality that can be used by other packages. For example:
package main
import (
"fmt"
"math/rand"
)
func main() {
fmt.Println("My favorite number is", rand.Intn(10))
}
This program is an executable. It is a "main" package and imports from the fmt and math/rand library packages.
Fix the bug in the code.