diff options
author | David Crawshaw <crawshaw@golang.org> | 2016-03-04 14:53:26 -0500 |
---|---|---|
committer | David Crawshaw <crawshaw@golang.org> | 2016-03-04 20:34:30 +0000 |
commit | 69285a8b46c1d7588d0542d4f9d00f03cbfcbca9 (patch) | |
tree | 86ddee7d802dbea8650bea02756aa4d370cf196a /src/runtime/type.go | |
parent | 4c69e92f51645c291dc4c74aed5c56ecb0dcd57f (diff) | |
download | go-69285a8b46c1d7588d0542d4f9d00f03cbfcbca9.tar.gz go-69285a8b46c1d7588d0542d4f9d00f03cbfcbca9.zip |
reflect: recognize unnamed directional channels
go test github.com/onsi/gomega/gbytes now passes at tip, and tests
added to the reflect package.
Fixes #14645
Change-Id: I16216c1a86211a1103d913237fe6bca5000cf885
Reviewed-on: https://go-review.googlesource.com/20221
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/runtime/type.go')
-rw-r--r-- | src/runtime/type.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/runtime/type.go b/src/runtime/type.go index 18c6a32ecb..2312f819ea 100644 --- a/src/runtime/type.go +++ b/src/runtime/type.go @@ -42,10 +42,14 @@ func (t *_type) name() string { if hasPrefix(t._string, "chan ") { return "" } + if hasPrefix(t._string, "chan<-") { + return "" + } if hasPrefix(t._string, "func(") { return "" } - if t._string[0] == '[' || t._string[0] == '*' { + switch t._string[0] { + case '[', '*', '<': return "" } i := len(t._string) - 1 |