Feature Request - Have methods for structs to be collapsed by default (with 
an arrow next to the type def to reveal them) in the Index section of 
godocs.

Reasoning: Some packages include multiple structs with methods. For 
example, https://golang.org/pkg/math/big/ has Accuracy, ErrNaN, Float, Int, 
Rat, and RoundingMode with the Float, Int, Rat types have many methods. If 
the methods were collapsed by default, I could click to expand the Int type 
to look for the method I'm looking up. This is particularly useful for 
protos that define RPC endpoints. I'm currently working with a proto that 
defines 21 Request/Response protos where each has at least 10 methods 
associated with them. When I'm looking at that godoc, there's really only 
one struct that I want to look at. The major sections (Overview, Index, 
etc) already have an arrow to collapse the section.

Currently:
type Accuracy <https://golang.org/pkg/math/big/#Accuracy>    func (i 
Accuracy) String() string 
<https://golang.org/pkg/math/big/#Accuracy.String>type 
ErrNaN <https://golang.org/pkg/math/big/#ErrNaN>    func (err ErrNaN) 
Error() string <https://golang.org/pkg/math/big/#ErrNaN.Error>type Float 
<https://golang.org/pkg/math/big/#Float>    func NewFloat(x float64) *Float 
<https://golang.org/pkg/math/big/#NewFloat>    func ParseFloat(s string, 
base int, prec uint, mode RoundingMode) (f *Float, b int, err error) 
<https://golang.org/pkg/math/big/#ParseFloat>    func (z *Float) Abs(x 
*Float) *Float <https://golang.org/pkg/math/big/#Float.Abs>    func (x 
*Float) Acc() Accuracy <https://golang.org/pkg/math/big/#Float.Acc>    func 
(z *Float) Add(x, y *Float) *Float 
<https://golang.org/pkg/math/big/#Float.Add>    func (x *Float) Append(buf 
[]byte, fmt byte, prec int) []byte 
<https://golang.org/pkg/math/big/#Float.Append>    func (x *Float) Cmp(y 
*Float) int <https://golang.org/pkg/math/big/#Float.Cmp>    func (z *Float) 
Copy(x *Float) *Float <https://golang.org/pkg/math/big/#Float.Copy>    func 
(x *Float) Float32() (float32, Accuracy) 
<https://golang.org/pkg/math/big/#Float.Float32>    func (x *Float) 
Float64() (float64, Accuracy) 
<https://golang.org/pkg/math/big/#Float.Float64>    ...
Request (click the arrow to expand the method list):type Accuracy 
<https://golang.org/pkg/math/big/#Accuracy>  >type ErrNaN 
<https://golang.org/pkg/math/big/#ErrNaN>  >type Float 
<https://golang.org/pkg/math/big/#Float>  >type Int 
<https://golang.org/pkg/math/big/#Int>  >
type Rat <https://golang.org/pkg/math/big/#Rat>  >
type RoundingMode <https://golang.org/pkg/math/big/#RoundingMode>  >type 
Word <https://golang.org/pkg/math/big/#Word>

Are there any counter-arguments for why we wouldn't want this for the docs?

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to