Skip to content

cmd/godoc: missing some functions when using dot imports #13742

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

Closed
nodirt opened this issue Dec 27, 2015 · 5 comments
Closed

cmd/godoc: missing some functions when using dot imports #13742

nodirt opened this issue Dec 27, 2015 · 5 comments
Milestone

Comments

@nodirt
Copy link
Contributor

nodirt commented Dec 27, 2015

Given

package x

import . "y"

// assume Y is defined in package y.

func F(Y) {}

func G() Y {
  return nil
}

godoc will displayF, but not G.

Repro: https://godoc.org/github.com/nodirt/tmp/godoc-bug should display function X.

@rsc
Copy link
Contributor

rsc commented Dec 28, 2015

Is this really about go/doc (the package)? It doesn't look like it.

@rsc rsc changed the title go/doc: hides functions whose return type are from a package imported as "." cmd/godoc: missing some functions when using dot imports Dec 28, 2015
@rsc
Copy link
Contributor

rsc commented Dec 28, 2015

/cc @griesemer fascinating

@nodirt
Copy link
Contributor Author

nodirt commented Dec 28, 2015

FWIU, the root cause lies somewhere under https://godoc.org/go/doc#New

@griesemer
Copy link
Contributor

This is indeed an issue with go/doc: The function G() Y is associated with type Y (as a "constructor") but Y is not locally declared and thus its associated constructors are never emitted.

(dot imports are not worth the trouble they've caused overall)

@griesemer griesemer self-assigned this Jan 8, 2016
@griesemer griesemer added this to the Go1.6 milestone Jan 8, 2016
@gopherbot
Copy link
Contributor

CL https://golang.org/cl/18393 mentions this issue.

@golang golang locked and limited conversation to collaborators Jan 7, 2017
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