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

Comments

Projects
None yet
7 participants
@chai2010
Copy link
Contributor

commented Jun 17, 2014

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

This comment has been minimized.

Copy link
Contributor

commented Jun 17, 2014

Comment 1:

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

@griesemer

This comment has been minimized.

Copy link
Contributor

commented Jun 17, 2014

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

This comment has been minimized.

Copy link
Contributor Author

commented Jun 18, 2014

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

This comment has been minimized.

Copy link
Contributor

commented Sep 2, 2014

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

This comment has been minimized.

Copy link
Contributor

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

@rsc rsc removed release-none labels Apr 10, 2015

@rakyll

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Member

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.

@gopherbot

This comment has been minimized.

Copy link

commented Jun 3, 2018

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.)

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.