### What version of Go are you using (`go version`)? Playground go1.16.5 ### Does this issue reproduce with the latest release? ### What operating system and processor architecture are you using (`go env`)? Playground whatever. ### What did you do? Playground [link](https://play.golang.org/p/WaRxepD570I) <pre> package main import ( "fmt" "strings" "runtime" ) func main() { println(runtime.Version()) ss := []string{ `Core.go`, `DebugInfo.go`, `Verifier.go` } sfx := `.go` for _, s := range ss { s_ := strings.TrimRight(s, sfx) fmt.Println(s_) } } </pre> ### What did you expect to see? <pre> go1.16.5 Core DebugInfo Verifier </pre> ### What did you see instead? <pre> go1.16.5 Core DebugInf Verifier </pre>
Activity
ALTree commentedon Jun 23, 2021
TrimRighttakes a cutset, which means that ALL.,g, andoon the right will be removed. What you want isTrimSuffix.