mirror of
https://github.com/golang/go
synced 2024-11-25 09:57:57 -07:00
cmd/gofmt: fix simplify.go by running gofmt on cmd/gofmt
R=golang-dev CC=golang-dev https://golang.org/cl/5539061
This commit is contained in:
parent
439d863e7c
commit
c40314821b
@ -50,8 +50,8 @@ func (s *simplifier) Visit(node ast.Node) ast.Visitor {
|
|||||||
if addr, ok := x.(*ast.UnaryExpr); ok && addr.Op == token.AND {
|
if addr, ok := x.(*ast.UnaryExpr); ok && addr.Op == token.AND {
|
||||||
if inner, ok := addr.X.(*ast.CompositeLit); ok {
|
if inner, ok := addr.X.(*ast.CompositeLit); ok {
|
||||||
if match(nil, reflect.ValueOf(ptr.X), reflect.ValueOf(inner.Type)) {
|
if match(nil, reflect.ValueOf(ptr.X), reflect.ValueOf(inner.Type)) {
|
||||||
inner.Type = nil // drop T
|
inner.Type = nil // drop T
|
||||||
*px = inner // drop &
|
*px = inner // drop &
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user