-
Notifications
You must be signed in to change notification settings - Fork 18.3k
Closed
Labels
FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.Proposal-Acceptedokay-after-beta1Used by release team to mark a release-blocker issue as okay to resolve either before or after beta1Used by release team to mark a release-blocker issue as okay to resolve either before or after beta1release-blocker
Milestone
Description
#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.
tmthrgd, a8m, mvdan, jdstorm, jimmyfrasche and 26 moreAlekSi, tovare, dmitshur and dkotik
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.Proposal-Acceptedokay-after-beta1Used by release team to mark a release-blocker issue as okay to resolve either before or after beta1Used by release team to mark a release-blocker issue as okay to resolve either before or after beta1release-blocker
Type
Projects
Relationships
Development
Select code repository
Activity
agnivade commentedon Jun 8, 2019
@alandonovan @mvdan
networkimprov commentedon Jun 8, 2019
Pls also permit
string(b)
where b is abyte
oruint8
.string(int)
andstring(rune)
#32758mvdan commentedon Jun 24, 2019
This seems fine to me. The warning should probably point the user in the right direction.
alanfo commentedon Jun 27, 2019
I think this is essential if this proposal (and eventually #3939) is to be adopted.
The
string(byte)
conversion, when you're dealing with ASCII characters only, is probably used at least as often asstring(rune)
in my experience.dolmen commentedon Jul 2, 2019
@networkimprov @alanfo You will still be able to use
string([]byte{b})
.networkimprov commentedon Jul 2, 2019
That would be a surprising requirement. And allocates a byte slice for a single statement?
alanfo commentedon Jul 2, 2019
@dolmen
Well
string(rune(b))
would be a better alternative because you wouldn't then have to allocate a byte slice but it would still be a nuisance to have to update all my code to use this workaround :(244 remaining items