Issue #3939 proposes removing the conversion from integer types to string types. In order to do that, it will be convenient if we have an exact replacement in the standard library.
I propose adding a new function to the unicode/utf8 package:
func String(r rune) string
This function will return a string containing the UTF-8 encoding of its argument.
The implementation will be equivalent to the following, though of course it may be further optimized.
func String(r rune) string {
var a [4]byte
return string(a[:EncodeRune(a[:], r)])
}
Issue #3939 proposes removing the conversion from integer types to string types. In order to do that, it will be convenient if we have an exact replacement in the standard library.
I propose adding a new function to the unicode/utf8 package:
This function will return a string containing the UTF-8 encoding of its argument.
The implementation will be equivalent to the following, though of course it may be further optimized.