Thread with 3 posts

jump to expanded post

is there something similar to ReplaceAllStringFunc for golang's regexp which takes fn(string,string) so that I can strings.trimSuffix(s, "::") or is there a more generalized way how I can get this:
re := regexp.MustCompile("(?m)^[^#][a-zA-Z]+::")
re.ReplaceAllString(s, *re, but with one of the trailing double collons removed*)

Open thread at this post