Skip to content

Commit 4e95093

Browse files
callthingsoffgopherbot
authored andcommitted
cmd/compile/internal/syntax: use strings.TrimPrefix in typeOf
Change-Id: I38c2a1afa1684b069522cd1b74529ae10f019ce8 GitHub-Last-Rev: 8c726f1 GitHub-Pull-Request: #63894 Reviewed-on: https://go-review.googlesource.com/c/go/+/539057 Run-TryBot: qiulaidongfeng <[email protected]> Run-TryBot: Robert Griesemer <[email protected]> Auto-Submit: Robert Griesemer <[email protected]> Reviewed-by: Robert Griesemer <[email protected]> Reviewed-by: qiulaidongfeng <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Cherry Mui <[email protected]>
1 parent a334c45 commit 4e95093

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/cmd/compile/internal/syntax/nodes_test.go

+1-4
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,5 @@ func stripAt(s string) (string, int) {
322322
func typeOf(n Node) string {
323323
const prefix = "*syntax."
324324
k := fmt.Sprintf("%T", n)
325-
if strings.HasPrefix(k, prefix) {
326-
return k[len(prefix):]
327-
}
328-
return k
325+
return strings.TrimPrefix(k, prefix)
329326
}

0 commit comments

Comments
 (0)