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

cmd/doc: constructor sometimes not associated with type #50040

Open
dsnet opened this issue Dec 8, 2021 · 0 comments
Open

cmd/doc: constructor sometimes not associated with type #50040

dsnet opened this issue Dec 8, 2021 · 0 comments
Labels
NeedsFix
Milestone

Comments

@dsnet
Copy link
Member

@dsnet dsnet commented Dec 8, 2021

Using go1.17.1

When I run:

$ go doc net/http.Request

I see (with some irrelevant details removed):

package http // import "net/http"

type Request struct {
    ...
}

func (r *Request) AddCookie(c *Cookie)
func (r *Request) BasicAuth() (username, password string, ok bool)
func (r *Request) Clone(ctx context.Context) *Request
func (r *Request) Context() context.Context
func (r *Request) Cookie(name string) (*Cookie, error)
func (r *Request) Cookies() []*Cookie
func (r *Request) FormFile(key string) (multipart.File, *multipart.FileHeader, error)
func (r *Request) FormValue(key string) string
func (r *Request) MultipartReader() (*multipart.Reader, error)
func (r *Request) ParseForm() error
func (r *Request) ParseMultipartForm(maxMemory int64) error
func (r *Request) PostFormValue(key string) string
func (r *Request) ProtoAtLeast(major, minor int) bool
func (r *Request) Referer() string
func (r *Request) SetBasicAuth(username, password string)
func (r *Request) UserAgent() string
func (r *Request) WithContext(ctx context.Context) *Request
func (r *Request) Write(w io.Writer) error
func (r *Request) WriteProxy(w io.Writer) error

This only lists the methods of Request, but does not show any of the constructor functions:

I would expect it to list the constructors as well, since it does so for other types (e.g., go doc compress/gzip.Reader).

Also, the fact that it does not list the constructors is inconsistent with go.pkg.dev, which does group those three functions with the type.

@toothrot toothrot added this to the Backlog milestone Dec 8, 2021
@toothrot toothrot added the NeedsFix label Dec 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsFix
Projects
None yet
Development

No branches or pull requests

2 participants