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

  1. 1
    Your First Program and Output

    Your first Go program: package main, import and fmt.Println.

  2. 2
    Variables and Data Types

    var and := declarations, the int, int64, float64, string, bool types.

  3. 3
    Reading Input: bufio

    Reading input with fmt.Scan and the & pointers.

    1 problems

  4. 4
    Conditional Statements

    if/else if/else without parentheses, logical && and ||.

    1 problems

  5. 5
    The for Loop

    The single for loop and its three forms; accumulating a result.

    2 problems

  6. 6
    Arrays and Slices

    Slices: make, append, range and finding the maximum.

    1 problems

  7. 7
    Strings

    Strings, the strings package, runes and reversing a string via []rune.

    3 problems

  8. 8
    Functions

    Functions: parameters, multiple return values, GCD and primality.

    2 problems

  9. 9
    Maps and Structs

    Maps and structs: counting occurrences and composite data.

  10. 10
    Contest Setup: Fast I/O

    bufio: fast input/output and the Go contest template.

Доска