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: Minor inconsistency when representing structures with unexported identifiers. #6713

Closed
mewmew opened this issue Nov 4, 2013 · 7 comments

Comments

@mewmew
Copy link
Contributor

mewmew commented Nov 4, 2013

What steps will reproduce the problem?
If possible, include a link to a program on play.golang.org.

play.golang.org: http://play.golang.org/p/diJ8fD6QI1
godoc.org: http://godoc.org/github.com/mewmew/playground/p2

1. The following example package contains four types (T1, T2, T3, T4): 
2. The visual representation of T3 and T4 differs.

What is the expected output?
Consistent visual representation of T3 and T4.

What do you see instead?
A whitespace is inserted before the doc comment of the exported member in T4.

Which compiler are you using (5g, 6g, 8g, gccgo)?
6g

Which operating system are you using?
Arch Linux

Which version are you using?  (run 'go version')
go version devel +dc2762a9130d Mon Nov 04 17:41:08 2013 +1100 linux/amd64
go.tools: changeset 483:1c0539e4d906

Please provide any additional information below.
As mentioned in the summary this is indeed a minor inconsistency and there may exist a
good reason for it. Either way, wanted to report it so we can discuss it.
@mewmew
Copy link
Contributor Author

mewmew commented Nov 4, 2013

Comment 1:

Attaching a screenshot.

Attachments:

  1. godoc-inconsistency.png (20486 bytes)

@adg
Copy link
Contributor

adg commented Nov 5, 2013

Comment 2:

Definitely a minor thing but worth cleaning up.
You won't see this much because it's rare to put unexported fields before exported
fields.

Labels changed: added priority-later, godoc, removed priority-triage.

Status changed to Accepted.

@rsc
Copy link
Contributor

rsc commented Nov 27, 2013

Comment 3:

Labels changed: added go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 4:

Labels changed: added release-none, removed go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 5:

Labels changed: added repo-tools.

@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@rsc rsc changed the title cmd/godoc: Minor inconsistency when representing structures with unexported identifiers. x/tools/cmd/godoc: Minor inconsistency when representing structures with unexported identifiers. Apr 14, 2015
@rsc rsc removed the repo-tools label Apr 14, 2015
@mewmew
Copy link
Contributor Author

mewmew commented May 31, 2016

Commit 7cd6cae is related to this issue. While stated as a cleanup in the commit message, depending on the point of view, the change may be considered a hack to work around the GoDoc presentation issue related to unexported identifiers. Just wanted to mention it in the relevant issue, as it may affect other commits in the future.

mewmew referenced this issue May 31, 2016
As rendered on https://tip.golang.org/pkg/compress/flate/, there is an
extra new-line because of the unexported constants in the same block.

<<<
const (
    NoCompression      = 0
    BestSpeed          = 1
    BestCompression    = 9
    DefaultCompression = -1
    HuffmanOnly        = -2 // Disables match search and only does Huffman entropy reduction.

)
>>>

Instead, seperate the exported compression level constants into its own
const block. This is both more readable and also fixes the issue.

Change-Id: I60b7966c83fb53356c02e4640d05f55a3bee35b7
Reviewed-on: https://go-review.googlesource.com/23557
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
@mewmew
Copy link
Contributor Author

mewmew commented Jan 19, 2017

Close the issue for now as it has remained inactive for more than 6 months.

Anyone with more insight into the current status may re-open the issue or add a comment about the current progress.

@mewmew mewmew closed this as completed Jan 19, 2017
@golang golang locked and limited conversation to collaborators Jan 19, 2018
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

4 participants