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
The testing package provides a mechanism to produce distinct examples for a single package, function, type or method.
Multiple example functions for a package/type/function/method may be provided by appending a distinct suffix to the name. The suffix must start with a lower-case letter.
Currently, this is specified to be defined by a suffix that starts with a lower-case letter. This restrictions is presumably to ensure that a method (which must start with an upper-case letter to be justified in having a documentation example by virtue of being exported) is distinguishable from a suffix tag. The godoc command has always allowed numeric and first characters, enabling the use of culturally conventional numbered examples and use of 'words' that start with a number (see #43454 for the motivation for this proposal). It's worth noting that the only requirement for distinguishing between a method _M and a human-directed _suffix would be that the suffix can not be interpretable as a method worth documenting; it must not have an upper-case initial.
Proposal
Relax the documented restriction to be "The suffix must not start with an upper-case letter."
The text was updated successfully, but these errors were encountered:
Background
The testing package provides a mechanism to produce distinct examples for a single package, function, type or method.
Currently, this is specified to be defined by a suffix that starts with a lower-case letter. This restrictions is presumably to ensure that a method (which must start with an upper-case letter to be justified in having a documentation example by virtue of being exported) is distinguishable from a suffix tag. The godoc command has always allowed numeric and first characters, enabling the use of culturally conventional numbered examples and use of 'words' that start with a number (see #43454 for the motivation for this proposal). It's worth noting that the only requirement for distinguishing between a method
_M
and a human-directed_suffix
would be that the suffix can not be interpretable as a method worth documenting; it must not have an upper-case initial.Proposal
Relax the documented restriction to be "The suffix must not start with an upper-case letter."
The text was updated successfully, but these errors were encountered: