Skip to content

iota logic mismatch #39751

@watson-2018

Description

@watson-2018

What version of Go are you using (go version)?

$ go version go1.13.10 linux/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GOARCH="amd64"
GOOS="linux"
GOHOSTARCH="amd64"
GOHOSTOS="linux"

What did you do?

type myConst int

const (
        zero myConst = iota
        one
        three = iota + 1
        foure
        five = iota + 1
)

func testIota() {
        // 3 4 5 why not 3 4 6
        fmt.Println(three, foure, five)
}

What did you expect to see?

why output is 3 4 5 not 3 4 6

What did you see instead?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions