]> Cypherpunks repositories - gostls13.git/commit
go/doc: tune association of a function with a type
authorAgniva De Sarker <agnivade@yahoo.co.in>
Sun, 8 Apr 2018 10:37:25 +0000 (16:07 +0530)
committerRobert Griesemer <gri@golang.org>
Tue, 10 Apr 2018 20:19:50 +0000 (20:19 +0000)
commit607953609c7c04f129564a4bd886ae72773aa196
treed29956146a8959a840354fd93dad5dd876d28bac
parent95e6a9fc50bbd2cb5dc643ce93dfef582a2fd07a
go/doc: tune association of a function with a type

Previously, we used to associate a function with its first returned type
assuming that it is a factory function for that type.

However, a function may return multiple types in which case it is usually
doing something else. Check for multiple return types, and treat it as
a normal function in that case. Maintain same behavior if the function
returns just one type.

Fixes #12839

Change-Id: Ic4ac11d322996f216f593b71f4e61ad4270d5213
Reviewed-on: https://go-review.googlesource.com/105575
Reviewed-by: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/go/doc/reader.go
src/go/doc/testdata/issue12839.0.golden [new file with mode: 0644]
src/go/doc/testdata/issue12839.1.golden [new file with mode: 0644]
src/go/doc/testdata/issue12839.2.golden [new file with mode: 0644]
src/go/doc/testdata/issue12839.go [new file with mode: 0644]