You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue #3939 proposes eliminating the conversion from integer types to string types. Examining code shows that one common case where the conversion is used correctly is string(os.PathSeparator). If we eliminate the conversion from the language, we will need a replacement for code of that sort, ideally one that does not involve a function call.
I propose that we add two new constants to the os package: PathSeparatorString and PathListSeparatorString. These are the best names I've come up with, but they are not great, and I would be happy to hear better suggestions. The new constants will have the same value as the current constants PathSeparator and PathListSeparator, but will be untyped string constants rather than untyped rune constants.
Similarly, I propose that we add SeparatorString and ListSeparatorString to the path/filepath package.
The text was updated successfully, but these errors were encountered:
@networkimprov I don't see a good reason to change from Separator to Delimiter. We have existing functions like os.IsPathSeparator and no good reason to change them.
If removing string(rune(n)) will break lots of things, please give examples on #3939. It may be that we should not accept that proposal.
@Gnouc Separators are logically part of the os and path/filepath packages. They don't have anything to do with the strings package.
Issue #3939 proposes eliminating the conversion from integer types to string types. Examining code shows that one common case where the conversion is used correctly is
string(os.PathSeparator)
. If we eliminate the conversion from the language, we will need a replacement for code of that sort, ideally one that does not involve a function call.I propose that we add two new constants to the os package:
PathSeparatorString
andPathListSeparatorString
. These are the best names I've come up with, but they are not great, and I would be happy to hear better suggestions. The new constants will have the same value as the current constantsPathSeparator
andPathListSeparator
, but will be untyped string constants rather than untyped rune constants.Similarly, I propose that we add
SeparatorString
andListSeparatorString
to the path/filepath package.The text was updated successfully, but these errors were encountered: