mirror of
https://github.com/golang/go
synced 2024-11-18 18:44:42 -07:00
go.tools: cleanups (added copyrights to astutil, clearer logic in go/types)
R=adonovan CC=golang-dev https://golang.org/cl/29110043
This commit is contained in:
parent
df6f0829a2
commit
849643aaaf
@ -1,3 +1,7 @@
|
||||
// Copyright 2013 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// Package astutil contains common utilities for working with the Go AST.
|
||||
package astutil
|
||||
|
||||
|
@ -1,3 +1,7 @@
|
||||
// Copyright 2013 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package astutil
|
||||
|
||||
import (
|
||||
|
@ -115,8 +115,9 @@ func WriteType(buf *bytes.Buffer, this *Package, typ Type) {
|
||||
s = "<-chan "
|
||||
default:
|
||||
s = "chan "
|
||||
if c, _ := t.elem.(*Chan); c != nil {
|
||||
parens = c.dir == ast.RECV
|
||||
// chan (<-chan T) requires parentheses
|
||||
if c, _ := t.elem.(*Chan); c != nil && c.dir == ast.RECV {
|
||||
parens = true
|
||||
}
|
||||
}
|
||||
buf.WriteString(s)
|
||||
|
Loading…
Reference in New Issue
Block a user