You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36
Screenshot
What did you do?
Look for documentation on net/http.Get, or really any exported function that returns a type defined in the same package.
What did you expect to see?
Get should be grouped under Functions on the left sidebar, together with other functions like Handle and Serve.
In general, I'd expect to see all exported functions grouped there, except for methods and constructors. I'd define a constructor as a function named New or NewX where X is the name of a type defined in the package, returning a value or a pointer of that type and maybe an error.
What did you see instead?
Get is grouped together with the Response type. It has the signature:
func Get(url string) (resp *Response, err error)
I think it's grouped with Response because it returns *Response. Maybe it's considered a constructor?
This isn't new behavior in pkg.go.dev. Both https://golang.org/pkg/net/http and https://godoc.org/net/http have this behavior, too. The new left sidebar is much more prominent than the index was on those sites, so this issue is more of a problem now.
The text was updated successfully, but these errors were encountered:
Possible dup of #38666, #28006, and related to #39813 and #27928, which discuss the go/doc heuristic for identifying "factory functions" (best explained by this comment).
What is the URL of the page with the issue?
Example: https://pkg.go.dev/net/http?tab=doc#Get
What is your user agent?
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36
Screenshot
What did you do?
Look for documentation on
net/http.Get
, or really any exported function that returns a type defined in the same package.What did you expect to see?
Get
should be grouped under Functions on the left sidebar, together with other functions likeHandle
andServe
.In general, I'd expect to see all exported functions grouped there, except for methods and constructors. I'd define a constructor as a function named
New
orNewX
whereX
is the name of a type defined in the package, returning a value or a pointer of that type and maybe an error.What did you see instead?
Get
is grouped together with theResponse
type. It has the signature:I think it's grouped with
Response
because it returns*Response
. Maybe it's considered a constructor?This isn't new behavior in pkg.go.dev. Both https://golang.org/pkg/net/http and https://godoc.org/net/http have this behavior, too. The new left sidebar is much more prominent than the index was on those sites, so this issue is more of a problem now.
The text was updated successfully, but these errors were encountered: