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

go 1.17.7 new issue #198

Open
jdvjdv82 opened this issue Feb 17, 2022 · 0 comments
Open

go 1.17.7 new issue #198

jdvjdv82 opened this issue Feb 17, 2022 · 0 comments

Comments

@jdvjdv82
Copy link

Hi there,
please consider following:

type Mode uint8

const (
	Reserved Mode = iota
        Foo
        Bar
)
func (m Mode) String() string {
	switch m {
	case Foo:
		return "Foo"
	case Bar:
		return "Bar"
       default:
		return "Reserved"
	}
}

For golang < 1.17.7 I was using {{ .Mode }} and it was displayed as 0, 1, 2
Now it is displayed as Reserved, Foo, Bar.

So Stringer interface somehow kicks in.

There is easy workaround, but I just want to know if there is need to adjust Jet or file an issue to golang directly.

Thanks and all the best

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant