Go v1.8 enabled go doc to show the doc for an individual interface method, so why not do the same for struct fields? Like:
$ go doc net/http RoundTripper.RoundTrip
// RoundTrip executes a single HTTP transaction, returning
// a Response for the provided Request.
//
// RoundTrip should not attempt to interpret the response. In
// particular, RoundTrip must return err == nil if it obtained
// a response, regardless of the response's HTTP status code.
// A non-nil err should be reserved for failure to obtain a
// response. Similarly, RoundTrip should not attempt to
// handle higher-level protocol details such as redirects,
// authentication, or cookies.
//
// RoundTrip should not modify the request, except for
// consuming and closing the Request's Body.
//
// RoundTrip must always close the body, including on errors,
// but depending on the implementation may do so in a separate
// goroutine even after RoundTrip returns. This means that
// callers wanting to reuse the body for subsequent requests
// must arrange to wait for the Close call before doing so.
//
// The Request's URL and Header fields must be initialized.
func RoundTrip(*Request) (*Response, error)
$ go doc net/http Response.Header
// Header maps header keys to values. If the response had multiple
// headers with the same key, they may be concatenated, with comma
// delimiters. (Section 4.2 of RFC 2616 requires that multiple headers
// be semantically equivalent to a comma-delimited sequence.) Values
// duplicated by other fields in this struct (e.g., ContentLength) are
// omitted from Header.
//
// Keys in the map are canonicalized (see CanonicalHeaderKey).
var Header Header
The text was updated successfully, but these errors were encountered:
robpike
removed
the
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
label
Mar 21, 2017
Go v1.8 enabled
go doc
to show the doc for an individual interface method, so why not do the same for struct fields? Like:The text was updated successfully, but these errors were encountered: