From ffc4ccea07cf497c99849f92b196d5c24e1612b7 Mon Sep 17 00:00:00 2001 From: Jes Cok Date: Wed, 30 Aug 2023 05:09:56 +0000 Subject: [PATCH] cmd/compile/internal/types2: use strings.ReplaceAll for goTypeName strings.ReplaceAll is currently available. Change-Id: I111b97f12723c97791b59d81fd035a0d5e97cd4b GitHub-Last-Rev: 561dbab6d22df42636f34a53a97c2f52b9138f3e GitHub-Pull-Request: golang/go#62369 Reviewed-on: https://go-review.googlesource.com/c/go/+/524157 Reviewed-by: Ian Lance Taylor Commit-Queue: Ian Lance Taylor LUCI-TryBot-Result: Go LUCI Reviewed-by: Robert Griesemer Auto-Submit: Ian Lance Taylor --- src/cmd/compile/internal/types2/typexpr.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/compile/internal/types2/typexpr.go b/src/cmd/compile/internal/types2/typexpr.go index bf353427ab5..de420e39c7c 100644 --- a/src/cmd/compile/internal/types2/typexpr.go +++ b/src/cmd/compile/internal/types2/typexpr.go @@ -207,7 +207,7 @@ func (check *Checker) genericType(e syntax.Expr, cause *string) Type { // goTypeName returns the Go type name for typ and // removes any occurrences of "types2." from that name. func goTypeName(typ Type) string { - return strings.Replace(fmt.Sprintf("%T", typ), "types2.", "", -1) // strings.ReplaceAll is not available in Go 1.4 + return strings.ReplaceAll(fmt.Sprintf("%T", typ), "types2.", "") } // typInternal drives type checking of types.