And found three things with multiple examples for one item
which I'd like to discuss before sending a CL:
A) Currently if more than one example is present for a function
both get their own a "> Example" fold-out which feels strange
as there might be three "> Examples" and you cannot tell which
one you are interested in.
I tried and included all examples into one fold-out which gets
labeled "> Examples" if there are two or more.
Is this considered useful/appropriate?
B) Currently multiple examples for the same item (func, type)
can be defined by suffixing them with "_.*". (Works well).
To add examples to methods Russ suggested in
http://code.google.com/p/go/issues/detail?id=2465
to name the examples like
func ExampleType_Method()
which interferes with the "use distinct _-suffixes" mentioned
above. I see two solutions which wouldn't need complete
reworking of godocs example mechanism:
1. Name examples for methods like
func ExampleTypeMethod() and hope there
isn't a function
func TypeMethod(...)
2. Restrict the "distinguishing suffixes" to numbers only:
func ExampleFunction()
func ExampleFunction_2()
func ExampleFunction_3()
func ExampleType_()
func ExampleType_2()
func ExampleType_Method()
func ExampleType_Method_2()
which has the advantage that it is unambiguous as there
are no functions/methods named with a letter and the
disadvantage that this imposes a restriction on the nameing
of several examples for one item.
C) Just to be sure: What is the preferred way: Little CLs,
one for each issue, or better one CL (a bit larger) for each
issue?
Volker
I tried to fix some of the issues regarding godoc, especially issues
with the examples (Issues 2467, 2466, 2465, 2464).And found three things with multiple examples for one item
which I'd like to discuss before sending a CL:A) Currently if more than one example is present for a function
both get their own a "> Example" fold-out which feels strange
as there might be three "> Examples" and you cannot tell which
one you are interested in.
I tried and included all examples into one fold-out which gets
labeled "> Examples" if there are two or more.
Is this considered useful/appropriate?
C) Just to be sure: What is the preferred way: Little CLs,
one for each issue, or better one CL (a bit larger) for each
issue?
I tried to fix some of the issues regarding godoc, especially issues
with the examples (Issues 2467, 2466, 2465, 2464).And found three things with multiple examples for one item
which I'd like to discuss before sending a CL:A) Currently if more than one example is present for a function
both get their own a "> Example" fold-out which feels strange
as there might be three "> Examples" and you cannot tell which
one you are interested in.
I tried and included all examples into one fold-out which gets
labeled "> Examples" if there are two or more.
Is this considered useful/appropriate?
C) Just to be sure: What is the preferred way: Little CLs,
one for each issue, or better one CL (a bit larger) for each
issue?