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/pkgsite: [Doc links] Cannot refer to types but Go Doc stated it could #67473

Closed
Z3NTL3 opened this issue May 17, 2024 · 3 comments
Closed

x/pkgsite: [Doc links] Cannot refer to types but Go Doc stated it could #67473

Z3NTL3 opened this issue May 17, 2024 · 3 comments
Labels
Milestone

Comments

@Z3NTL3
Copy link

Z3NTL3 commented May 17, 2024

What is the URL of the page with the issue?

https://go.dev/doc/comment#links

What is your user agent?

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36

Screenshot

image

What did you do?

// Client for both HTTP and HTTPS proxy
//
// Implements HTTP FORWARD and HTTP TUNNEL mechanism.
type HTTPClient struct {
	Auth // Authentication
	TLS bool // TLS
}

type Conn = net.Conn

// # Doc
//
// Tunnels through given proxy, for HTTPS you should 
// set [HTTPClient.TLS] to true, which will perform HTTP TUNNEL rather than HTTP Forward. 
// Defaults to false which is HTTP proxy aka HTTP FORWARD.
//
// Only HTTP TUNNEL (HTTPS) allows arbitrary data after initial handshake.
//
// # Example
//
// See ``tests`` directory for more examples.
//
// # Reference
//
// [HTTP proxy (HTTP FORWARD)]: https://en.wikipedia.org/wiki/Proxy_server#Implementations_of_proxies
// [HTTPS proxy (HTTP TUNNEL)]: https://en.wikipedia.org/wiki/HTTP_tunnel#HTTP_CONNECT_method
func (c *HTTPClient) PROXY(url string, proxy Context, timeout time.Duration) (conn Conn, err error)

Note

Please note that I have formatted it usinggofmt

What did you see happen?

image

It did not turn [HTTPClient.TLS] to hyper referenceable text (blue) .

What did you expect to see?

The Go Doc Comments website clearly states that this is valid, as of the following statement:

Doc links are links of the form “[Name1]” or “[Name1.Name2]” to refer to exported identifiers in the current package, or “[pkg]”, “[pkg.Name1]”, or “[pkg.Name1.Name2]” to refer to identifiers in other packages.
Source

Additionally

As an addition to the previous problem, I did found something different much stranger.

// # Reference
//
// [HTTP proxy (HTTP FORWARD)]: https://en.wikipedia.org/wiki/Proxy_server#Implementations_of_proxies
// [HTTPS proxy (HTTP TUNNEL)]: https://en.wikipedia.org/wiki/HTTP_tunnel#HTTP_CONNECT_method

This seems not to show anything at all but according to Go Doc this is valid!

image

"A span of unindented non-blank lines defines link targets when every line is of the form “[Text]: URL”. In other text in the same doc comment, “[Text]” represents a link to URL using the given text—in HTML, Text. For example:"
Source

@Z3NTL3 Z3NTL3 added the pkgsite label May 17, 2024
@gopherbot gopherbot added this to the Unreleased milestone May 17, 2024
@Z3NTL3 Z3NTL3 changed the title x/pkgsite: [Doc links] ability to refer to types x/pkgsite: [Doc links] NOT WORKING May 17, 2024
@Z3NTL3 Z3NTL3 changed the title x/pkgsite: [Doc links] NOT WORKING x/pkgsite: [Doc links] Cannot refer to types but Go Doc stated it can May 17, 2024
@Z3NTL3 Z3NTL3 changed the title x/pkgsite: [Doc links] Cannot refer to types but Go Doc stated it can x/pkgsite: [Doc links] Cannot refer to types but Go Doc stated it could May 17, 2024
@fzipp
Copy link
Contributor

fzipp commented May 17, 2024

Re your second part: you have to use the links, not just declare them, e.g.

// # Reference
//
// Bla bla bla [HTTP proxy (HTTP FORWARD)] bla bla bla [HTTPS proxy (HTTP TUNNEL)] bla bla.
//
// [HTTP proxy (HTTP FORWARD)]: https://en.wikipedia.org/wiki/Proxy_server#Implementations_of_proxies
// [HTTPS proxy (HTTP TUNNEL)]: https://en.wikipedia.org/wiki/HTTP_tunnel#HTTP_CONNECT_method

@Z3NTL3
Copy link
Author

Z3NTL3 commented May 18, 2024

Ye the second part was a misread. Looking forward for the solve for the first part.

Re your second part: you have to use the links, not just declare them, e.g.

// # Reference
//
// Bla bla bla [HTTP proxy (HTTP FORWARD)] bla bla bla [HTTPS proxy (HTTP TUNNEL)] bla bla.
//
// [HTTP proxy (HTTP FORWARD)]: https://en.wikipedia.org/wiki/Proxy_server#Implementations_of_proxies
// [HTTPS proxy (HTTP TUNNEL)]: https://en.wikipedia.org/wiki/HTTP_tunnel#HTTP_CONNECT_method

Hey! Yes, thanks. The second part was a misread. Looking forward for a solve for the first part.

@seankhliao
Copy link
Member

Duplicate of #56004

@seankhliao seankhliao marked this as a duplicate of #56004 May 18, 2024
@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants