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

x/tools/cmd/godoc: Unnecessary empty line in type description #9868

Closed
Thomasdezeeuw opened this issue Feb 13, 2015 · 4 comments
Closed

x/tools/cmd/godoc: Unnecessary empty line in type description #9868

Thomasdezeeuw opened this issue Feb 13, 2015 · 4 comments

Comments

@Thomasdezeeuw
Copy link
Contributor

On the following page http://golang.org/pkg/sync/#Pool an unnecessary empty line is added to the code. It's probably because it contains unexported fields an a new line before the public fields, but it would be nice if this empty is not shown. The same happens in the text version of the page: http://golang.org/pkg/sync/?m=text (manual scrolling required).

Continued from golang/gddo#243.

@parkr
Copy link

parkr commented Feb 14, 2015

This is probably a godoc problem, actually. The code looks like this:

type Pool struct {
    local     unsafe.Pointer // local fixed-size per-P pool, actual type is [P]poolLocal
    localSize uintptr        // size of the local array

    // New optionally specifies a function to generate
    // a value when Get would otherwise return nil.
    // It may not be changed concurrently with calls to Get.
    New func() interface{}
}

Godoc strips out the non-exported fields but doesn't trim the whitespace separating them.

@Thomasdezeeuw
Copy link
Contributor Author

That is what we found in the previous issue, as mentioned in golang/gddo#243.

@griesemer
Copy link
Contributor

This is a known problem and non-trivial to fix in general (sometimes we want the whitespace) with the current library support. There may be simple heuristics that might fix the problem in most cases.

This is a non-urgent issue.

@rsc rsc removed the godoc label Apr 10, 2015
@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@rsc rsc removed the priority-low label Apr 10, 2015
@robpike robpike changed the title go/doc: Unnecessary empty line in type description x/tools/cmd/godoc: Unnecessary empty line in type description Oct 25, 2016
@agnivade
Copy link
Contributor

Duplicate of #18264. This is a go/printer issue actually. Closing this since there has been more activity on that issue.

@golang golang locked and limited conversation to collaborators May 31, 2019
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

6 participants