Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iota logic mismatch #39751

Closed
watson-2018 opened this issue Jun 22, 2020 · 1 comment
Closed

iota logic mismatch #39751

watson-2018 opened this issue Jun 22, 2020 · 1 comment

Comments

@watson-2018
Copy link

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?

@mvdan
Copy link
Member

mvdan commented Jun 22, 2020

The Go project doesn't use the issue tracker for questions. See https://golang.org/wiki/Questions.

@mvdan mvdan closed this as completed Jun 22, 2020
@golang golang locked and limited conversation to collaborators Jun 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants