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 contains common utilities for working with the Go AST.
|
||||||
package astutil
|
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
|
package astutil
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
||||||
|
|
@ -115,8 +115,9 @@ func WriteType(buf *bytes.Buffer, this *Package, typ Type) {
|
||||||
s = "<-chan "
|
s = "<-chan "
|
||||||
default:
|
default:
|
||||||
s = "chan "
|
s = "chan "
|
||||||
if c, _ := t.elem.(*Chan); c != nil {
|
// chan (<-chan T) requires parentheses
|
||||||
parens = c.dir == ast.RECV
|
if c, _ := t.elem.(*Chan); c != nil && c.dir == ast.RECV {
|
||||||
|
parens = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
buf.WriteString(s)
|
buf.WriteString(s)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue