{"action":"closed","issue":{"url":"https://api.github.com/repos/golang/go/issues/14004","repository_url":"https://api.github.com/repos/golang/go","labels_url":"https://api.github.com/repos/golang/go/issues/14004/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/14004/comments","events_url":"https://api.github.com/repos/golang/go/issues/14004/events","html_url":"https://github.com/golang/go/issues/14004","id":127293601,"number":14004,"title":"go/doc: group constructors with types","user":{"login":"aclements","id":2688315,"avatar_url":"https://avatars.githubusercontent.com/u/2688315?v=3","gravatar_id":"","url":"https://api.github.com/users/aclements","html_url":"https://github.com/aclements","followers_url":"https://api.github.com/users/aclements/followers","following_url":"https://api.github.com/users/aclements/following{/other_user}","gists_url":"https://api.github.com/users/aclements/gists{/gist_id}","starred_url":"https://api.github.com/users/aclements/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aclements/subscriptions","organizations_url":"https://api.github.com/users/aclements/orgs","repos_url":"https://api.github.com/users/aclements/repos","events_url":"https://api.github.com/users/aclements/events{/privacy}","received_events_url":"https://api.github.com/users/aclements/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"robpike","id":4324516,"avatar_url":"https://avatars.githubusercontent.com/u/4324516?v=3","gravatar_id":"","url":"https://api.github.com/users/robpike","html_url":"https://github.com/robpike","followers_url":"https://api.github.com/users/robpike/followers","following_url":"https://api.github.com/users/robpike/following{/other_user}","gists_url":"https://api.github.com/users/robpike/gists{/gist_id}","starred_url":"https://api.github.com/users/robpike/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robpike/subscriptions","organizations_url":"https://api.github.com/users/robpike/orgs","repos_url":"https://api.github.com/users/robpike/repos","events_url":"https://api.github.com/users/robpike/events{/privacy}","received_events_url":"https://api.github.com/users/robpike/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/golang/go/milestones/6","html_url":"https://github.com/golang/go/milestones/Unplanned","labels_url":"https://api.github.com/repos/golang/go/milestones/6/labels","id":1055141,"number":6,"title":"Unplanned","description":"No plan to fix in any specific release.\r\n","creator":{"login":"rsc","id":104030,"avatar_url":"https://avatars.githubusercontent.com/u/104030?v=3","gravatar_id":"","url":"https://api.github.com/users/rsc","html_url":"https://github.com/rsc","followers_url":"https://api.github.com/users/rsc/followers","following_url":"https://api.github.com/users/rsc/following{/other_user}","gists_url":"https://api.github.com/users/rsc/gists{/gist_id}","starred_url":"https://api.github.com/users/rsc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsc/subscriptions","organizations_url":"https://api.github.com/users/rsc/orgs","repos_url":"https://api.github.com/users/rsc/repos","events_url":"https://api.github.com/users/rsc/events{/privacy}","received_events_url":"https://api.github.com/users/rsc/received_events","type":"User","site_admin":false},"open_issues":1322,"closed_issues":370,"state":"open","created_at":"2015-04-06T20:47:19Z","updated_at":"2016-04-21T21:45:29Z","due_on":"2099-12-31T05:00:00Z","closed_at":null},"comments":3,"created_at":"2016-01-18T19:17:57Z","updated_at":"2016-04-21T21:45:29Z","closed_at":"2016-04-21T21:45:29Z","body":"The godoc tool groups constructors with the types they construct in the package index. This is incredibly useful for organizing documentation and quickly understanding the relationships between package symbols.\r\n\r\nIn contrast, while the go doc tool does this grouping when you ask for a particular type's documentation, for package documentation it prints all functions before it prints types. It would be nice if the package documentation was grouped similarly to what godoc does.\r\n\r\nFor example, the current go doc output for \"go doc reflect\" looks like:\r\n\r\n```\r\n$ go doc reflect\r\n...\r\nfunc Copy(dst, src Value) int\r\nfunc DeepEqual(x, y interface{}) bool\r\nfunc Select(cases []SelectCase) (chosen int, recv Value, recvOK bool)\r\nfunc ArrayOf(count int, elem Type) Type\r\nfunc ChanOf(dir ChanDir, t Type) Type\r\nfunc FuncOf(in, out []Type, variadic bool) Type\r\nfunc MapOf(key, elem Type) Type\r\nfunc PtrTo(t Type) Type\r\nfunc SliceOf(t Type) Type\r\nfunc TypeOf(i interface{}) Type\r\nfunc Append(s Value, x ...Value) Value\r\nfunc AppendSlice(s, t Value) Value\r\nfunc Indirect(v Value) Value\r\nfunc MakeChan(typ Type, buffer int) Value\r\nfunc MakeFunc(typ Type, fn func(args []Value) (results []Value)) Value\r\nfunc MakeMap(typ Type) Value\r\nfunc MakeSlice(typ Type, len, cap int) Value\r\nfunc New(typ Type) Value\r\nfunc NewAt(typ Type, p unsafe.Pointer) Value\r\nfunc ValueOf(i interface{}) Value\r\nfunc Zero(typ Type) Value\r\ntype ChanDir int\r\ntype Kind uint\r\ntype Method struct { ... }\r\ntype SelectCase struct { ... }\r\ntype SelectDir int\r\ntype SliceHeader struct { ... }\r\ntype StringHeader struct { ... }\r\ntype StructField struct { ... }\r\ntype StructTag string\r\ntype Type interface { ... }\r\ntype Value struct { ... }\r\ntype ValueError struct { ... }\r\n...\r\n```\r\n\r\nSomething is clearly putting constructor functions together, but they're printed separately from the type they construct. This would be much clearer if it were something like the following:\r\n\r\n```\r\n$ go doc reflect\r\n...\r\nfunc Copy(dst, src Value) int\r\nfunc DeepEqual(x, y interface{}) bool\r\nfunc Select(cases []SelectCase) (chosen int, recv Value, recvOK bool)\r\ntype ChanDir int\r\ntype Kind uint\r\ntype Method struct { ... }\r\ntype SelectCase struct { ... }\r\ntype SelectDir int\r\ntype SliceHeader struct { ... }\r\ntype StringHeader struct { ... }\r\ntype StructField struct { ... }\r\ntype StructTag string\r\ntype Type interface { ... }\r\n    func ArrayOf(count int, elem Type) Type\r\n    func ChanOf(dir ChanDir, t Type) Type\r\n    func FuncOf(in, out []Type, variadic bool) Type\r\n    func MapOf(key, elem Type) Type\r\n    func PtrTo(t Type) Type\r\n    func SliceOf(t Type) Type\r\n    func TypeOf(i interface{}) Type\r\ntype Value struct { ... }\r\n    func Append(s Value, x ...Value) Value\r\n    func AppendSlice(s, t Value) Value\r\n    func Indirect(v Value) Value\r\n    func MakeChan(typ Type, buffer int) Value\r\n    func MakeFunc(typ Type, fn func(args []Value) (results []Value)) Value\r\n    func MakeMap(typ Type) Value\r\n    func MakeSlice(typ Type, len, cap int) Value\r\n    func New(typ Type) Value\r\n    func NewAt(typ Type, p unsafe.Pointer) Value\r\n    func ValueOf(i interface{}) Value\r\n    func Zero(typ Type) Value\r\ntype ValueError struct { ... }\r\n...\r\n```\r\n\r\n/cc @robpike @griesemer "}}