-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed
Labels
FeatureRequestIssues asking for a new feature that does not need a proposal.Issues asking for a new feature that does not need a proposal.FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Description
Go version 1.13.
There does not seem to be a way to remove data written to a strings.Builder.
I'm currently doing the following:
func pathUrl(p []string) string {
var b []byte
for _, s := range p {
t := url.PathEscape(s)
b = append(b, t...)
b = append(b, '/')
}
return string(b[0 : len(b)-1])
}
The last line removes the trailing slash from the accumulated buffer. I don't see an obvious way of doing the same with a strings.Builder. Perhaps it would be a good idea to add UnwriteByte, UnwriteRune and perhaps UnwriteString functions to strings.Builder?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
FeatureRequestIssues asking for a new feature that does not need a proposal.Issues asking for a new feature that does not need a proposal.FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.