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: method expression type can be misidentified #34583

Open
athomason opened this issue Sep 27, 2019 · 3 comments
Open

x/tools/cmd/godoc: method expression type can be misidentified #34583

athomason opened this issue Sep 27, 2019 · 3 comments
Labels
help wanted NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@athomason
Copy link

What version of Go are you using (go version)?

$ go version
go version devel +739bf6b929 Fri Sep 27 21:17:15 2019 +0000 darwin/amd64

# golang.org/x/tools v0.0.0-20190927191325-030b2cf1153e

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

darwin/amd64

What did you do?

Examine the links generated for the definition of the DefaultTransport package var under https://tip.golang.org/pkg/net/http/#DefaultTransport. Notice that the value of the Transport's DialContext field is a method expression referencing net.Dialer.DialContext, but the generated link is to a non-existent http.DialContext function, creating a broken link.

<pre>var <span id="DefaultTransport">DefaultTransport</span> <a href="#RoundTripper">RoundTripper</a> = &amp;<a href="#Transport">Transport</a>{
    <a href="#Transport.Proxy">Proxy</a>: <a href="#ProxyFromEnvironment">ProxyFromEnvironment</a>,
    <a href="#Transport.DialContext">DialContext</a>: (&amp;<a href="/pkg/net/">net</a>.<a href="/pkg/net/#Dialer">Dialer</a>{
        <a href="/pkg/net/#Dialer.Timeout">Timeout</a>:   30 * <a href="/pkg/time/">time</a>.<a href="/pkg/time/#Second">Second</a>,
        <a href="/pkg/net/#Dialer.KeepAlive">KeepAlive</a>: 30 * <a href="/pkg/time/">time</a>.<a href="/pkg/time/#Second">Second</a>,
        <a href="/pkg/net/#Dialer.DualStack">DualStack</a>: <a href="/pkg/builtin/#true">true</a>,
    }).<a href="#DialContext">DialContext</a>,
    <a href="#Transport.ForceAttemptHTTP2">ForceAttemptHTTP2</a>:     <a href="/pkg/builtin/#true">true</a>,
    <a href="#Transport.MaxIdleConns">MaxIdleConns</a>:          100,
    <a href="#Transport.IdleConnTimeout">IdleConnTimeout</a>:       90 * <a href="/pkg/time/">time</a>.<a href="/pkg/time/#Second">Second</a>,
    <a href="#Transport.TLSHandshakeTimeout">TLSHandshakeTimeout</a>:   10 * <a href="/pkg/time/">time</a>.<a href="/pkg/time/#Second">Second</a>,
    <a href="#Transport.ExpectContinueTimeout">ExpectContinueTimeout</a>: 1 * <a href="/pkg/time/">time</a>.<a href="/pkg/time/#Second">Second</a>,
}</pre>

What did you expect to see?

<a href="/pkg/net/#Dialer.DialContext">DialContext</a>

What did you see instead?

<a href="#DialContext">DialContext</a>

@gopherbot gopherbot added this to the Unreleased milestone Sep 27, 2019
@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Sep 27, 2019
@agnivade agnivade added help wanted NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Sep 28, 2019
@agnivade
Copy link
Contributor

For those interested, the relevant code is in godoc/linkify.go.

@athomason
Copy link
Author

@agnivade thanks for the link to #9613, I thought this might be a dupe but searching for DialContext didn't turn it up.

@gopherbot
Copy link

Change https://golang.org/cl/204578 mentions this issue: godoc: fix malformed links in variable definitions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

3 participants