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: referred packages don't have link in documentation #8223

Closed
chai2010 opened this issue Jun 17, 2014 · 8 comments
Closed
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@chai2010
Copy link
Contributor

For example, the `image.Image` has no link:
http://godoc.org/github.com/chai2010/gopkg.image/bmp

The "github.com/chai2010/gopkg.image" package name is `image`.

I think we need a `ImportSpec.PkgName` for the original package name.
@ianlancetaylor
Copy link
Contributor

Comment 1:

Labels changed: added repo-main, release-go1.4.

@griesemer
Copy link
Contributor

Comment 2:

I don't think the reason for the missing link is in the (go/ast)ImportSpec: The
ImportSpec has _all_ information that is available in the original source (and the
original package name is not part of that - it can be "guessed" from the path, but it's
not certain).
The issue is likely elsewhere (go/doc perhaps).
I will leave this open so you can elaborate more if you disagree.

Status changed to WaitingForReply.

@chai2010
Copy link
Contributor Author

Comment 3:

I don't know the exact reason for the missing link.
But i think the "original package name" information is useful,
we should support it.
For example:
    import (
        myImage "github.com/chai2010/gopkg.image"
    )
There are three information in the import:
1. import path is "github.com/chai2010/gopkg.image".
2. original package name is "image".
3. local package name is "myImage".
The ast.ImportSpec only include the "import path" and the "local package name",
there is no "original package name".
If there is no "local package name", we don't know the package name.
    import (
        "github.com/chai2010/gopkg.image" // what is the package name?
    )
    var _ = image.NewRGBA(...) // image is a package name ?

@griesemer
Copy link
Contributor

Comment 4:

The ast.ImportSpec does not and _cannot_ know the "original package name". The original
package name is only know for certain if that package is actually imported - this is
beyond the scope of the ast. See go.tools/go/types for more info.
This is not a go/ast issue. Will update title.

Status changed to Accepted.

@rsc
Copy link
Contributor

rsc commented Sep 15, 2014

Comment 5:

Labels changed: added release-none, removed release-go1.4.

@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@rakyll
Copy link
Contributor

rakyll commented Aug 8, 2016

The same behavior would also good to have in the scope of x/tools/cmd/godoc, but also filed an issue for godoc.org at golang/gddo#433.

@rakyll rakyll changed the title godoc.org: referred packages don't have link in documentation x/tools/cmd/godoc: referred packages don't have link in documentation Aug 8, 2016
@agnivade
Copy link
Contributor

agnivade commented May 2, 2018

@chai2010 - I am having a bit of trouble reproducing the issue because the repo "github.com/chai2010/gopkg.image" doesn't exist now.

Do you have a sample repo or example to demonstrate the issue ?

AFAI see, the scenario myImage "github.com/chai2010/gopkg.image" gets properly linked.

@agnivade agnivade added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label May 3, 2018
@gopherbot
Copy link

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@golang golang locked and limited conversation to collaborators Jun 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

7 participants