Skip to content

tour: briefly explain += operator in flowcontrol/1 #436

@RegevTripp

Description

@RegevTripp

Context: https://tour.golang.org/flowcontrol/1

Build version go1.10.

Both the online tour and the one I've downloaded which is run on my native machine (MacOS High Sierra 10.13.3), show that the output of the for loop below is the integer 45:

package main

import "fmt"

func main() {
sum := 0
for i := 0; i < 10; i++ {
sum += i
}
fmt.Println(sum)
}

Where the output should be:

0
1
2
3
4
5
6
7
8
9

I am unsure if this issue has been flagged before, but it could be disruptive for new comers with no prior programming experience.

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions