Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/doc: missing blank line between doc comment and constructors #10859

Closed
rsc opened this issue May 14, 2015 · 1 comment
Closed

cmd/doc: missing blank line between doc comment and constructors #10859

rsc opened this issue May 14, 2015 · 1 comment
Milestone

Comments

@rsc
Copy link
Contributor

rsc commented May 14, 2015

$ go doc reflect.Type
...

    common() *rtype
    uncommon() *uncommonType
}
    Type is the representation of a Go type.

    Not all methods apply to all kinds of types. Restrictions, if any, are noted in
    the documentation for each method. Use the Kind method to find out the kind of
    type before calling kind-specific methods. Calling a method inappropriate to the
    kind of type causes a run-time panic.
func ArrayOf(count int, elem Type) Type
func ChanOf(dir ChanDir, t Type) Type
func FuncOf(in, out []Type, variadic bool) Type
func MapOf(key, elem Type) Type
func PtrTo(t Type) Type
func SliceOf(t Type) Type
func TypeOf(i interface{}) Type

There might be a missing blank line between the closing } and the doc comment. I'm on the fence about that. But there's definitely a missing blank line between the final line of the doc comment and the constructor list.

I wonder if the doc comment should be last, preceded by a blank line, and then it need not be indented:

$ go doc reflect.Type
...

    common() *rtype
    uncommon() *uncommonType
}

func ArrayOf(count int, elem Type) Type
func ChanOf(dir ChanDir, t Type) Type
func FuncOf(in, out []Type, variadic bool) Type
func MapOf(key, elem Type) Type
func PtrTo(t Type) Type
func SliceOf(t Type) Type
func TypeOf(i interface{}) Type

Type is the representation of a Go type.

Not all methods apply to all kinds of types. Restrictions, if any, are noted in
the documentation for each method. Use the Kind method to find out the kind of
type before calling kind-specific methods. Calling a method inappropriate to the
kind of type causes a run-time panic.
@rsc rsc added this to the Go1.5 milestone May 14, 2015
@gopherbot
Copy link

CL https://golang.org/cl/10160 mentions this issue.

@golang golang locked and limited conversation to collaborators Jun 25, 2016
@rsc rsc unassigned robpike Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants