Go from Scratch
Go is a simple and fast language. This course goes from your first program to slices, maps, and buffered I/O.
In this section
- 1Your First Program and Output
Your first Go program: package main, import and fmt.Println.
- 2Variables and Data Types
var and := declarations, the int, int64, float64, string, bool types.
- 3Reading Input: bufio
Reading input with fmt.Scan and the & pointers.
1 problems
- 4Conditional Statements
if/else if/else without parentheses, logical && and ||.
1 problems
- 5The for Loop
The single for loop and its three forms; accumulating a result.
2 problems
- 6Arrays and Slices
Slices: make, append, range and finding the maximum.
1 problems
- 7Strings
Strings, the strings package, runes and reversing a string via []rune.
3 problems
- 8Functions
Functions: parameters, multiple return values, GCD and primality.
2 problems
- 9Maps and Structs
Maps and structs: counting occurrences and composite data.
- 10Contest Setup: Fast I/O
bufio: fast input/output and the Go contest template.