mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: simplify exprformat untyped condition checking
L1337 in fmt.go can be checked just by using "!n.Type.IsUntyped". Passes toolstash-check. Change-Id: I5b0c81543bc929367f70713d0ca40b289f905b48 Reviewed-on: https://go-review.googlesource.com/c/go/+/262637 Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
parent
623319a847
commit
50b7171af0
1 changed files with 1 additions and 1 deletions
|
|
@ -1333,7 +1333,7 @@ func (n *Node) exprfmt(s fmt.State, prec int, mode fmtMode) {
|
|||
n.Orig.exprfmt(s, prec, mode)
|
||||
return
|
||||
}
|
||||
if n.Type != nil && n.Type.Etype != TIDEAL && n.Type.Etype != TNIL && n.Type != types.UntypedBool && n.Type != types.UntypedString {
|
||||
if n.Type != nil && !n.Type.IsUntyped() {
|
||||
// Need parens when type begins with what might
|
||||
// be misinterpreted as a unary operator: * or <-.
|
||||
if n.Type.IsPtr() || (n.Type.IsChan() && n.Type.ChanDir() == types.Crecv) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue