1
0
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:
Robert Griesemer 2013-11-19 09:07:02 -08:00
parent df6f0829a2
commit 849643aaaf
3 changed files with 11 additions and 2 deletions

View File

@ -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

View File

@ -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 (

View File

@ -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)