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

@watson-2018 watson-2018 commented Jun 22, 2020

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 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 Jun 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.