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

Comments

Projects
None yet
5 participants
@Thomasdezeeuw
Copy link
Contributor

commented Feb 13, 2015

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Contributor Author

commented Feb 14, 2015

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

@griesemer

This comment has been minimized.

Copy link
Contributor

commented Apr 1, 2015

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

This comment has been minimized.

Copy link
Member

commented May 31, 2018

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

@agnivade agnivade closed this May 31, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.