Misusing trim functions
Mistake
TrimRight removes all trailing runes in a given set.
fmt.Println(strings.TrimRight("123oxo", "xo")) // "123"
Fix
TrimSuffix removes a trailing suffix
fmt.Println(strings.TrimRight("123oxo", "xo")) // "123o"
TrimRight removes all trailing runes in a given set.
fmt.Println(strings.TrimRight("123oxo", "xo")) // "123"
TrimSuffix removes a trailing suffix
fmt.Println(strings.TrimRight("123oxo", "xo")) // "123o"