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

cmd/vet: warn about string(int) type conversions #32479

ianlancetaylor opened this issue Jun 7, 2019 · 3 comments


None yet
4 participants
Copy link

commented Jun 7, 2019

#3939 proposes removing the explicit type conversion string(i) where i has an integer type other than rune. That is a backward incompatible change, so we cannot make it until we can count on having modules everywhere, with the support modules provide for determining the version of the language to use to compile code.

There is a step we can take today, which is to change go vet to report conversions of integer types other than rune to string. If we think that removing this feature from the language is a good idea, then a vet check for it is a good idea, and it is one that we can implement today.

@ianlancetaylor ianlancetaylor added this to the Go1.14 milestone Jun 7, 2019


This comment has been minimized.

Copy link

commented Jun 8, 2019


This comment has been minimized.

Copy link

commented Jun 8, 2019

Pls also permit string(b) where b is a byte or uint8.


This comment has been minimized.

Copy link

commented Jun 24, 2019

This seems fine to me. The warning should probably point the user in the right direction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.