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
What did you expect to see?
I expected easy to find documentation for all parameters.
What did you see instead?
Instead I had difficulty discovering what the n parameter does.
Initially I ended up finding my answer on a stack overflow question, but later it was pointed out that the 'n' parameter is documented in the package level documentation. The package level documentation is well written and would have answered my question, but it is currently very difficult to find. Part of the problem is that it is within a paragraph so it is not easy to just browse to it and searching the page for 'n' is also not efficient.
Two solutions that come to mind are documenting the parameter on the functions that use it or maybe just renaming it to something searchable like count.
The text was updated successfully, but these errors were encountered:
ianlancetaylor
changed the title
Regexp documentation for 'n'
regexp: hard to find documentation for 'n'
Mar 1, 2016
func (re *Regexp) FindAllStringSubmatch(s string, n int) [][]string
FindAllStringSubmatch is the 'All' version of FindStringSubmatch; it returns
a slice of all successive matches of the expression, as defined by the 'All'
description in the package comment. A return value of nil indicates no
match.
It says "as defined by the 'All' description in the package comment". It sounds like you missed that clause, which I understand, but it's not clear that there's much to do. Docs will be misread, Stack Overflow and other sites will help.
Please answer these questions before submitting your issue. Thanks!
go version
)?go version go1.6 linux/amd64
go env
)?GOOS="linux"
GOARCH="amd64"
(Use play.golang.org to provide a runnable example, if possible.)
I read documentation at https://golang.org/pkg/regexp/#Regexp.FindAllStringSubmatch.
I expected easy to find documentation for all parameters.
Instead I had difficulty discovering what the
n
parameter does.Initially I ended up finding my answer on a stack overflow question, but later it was pointed out that the 'n' parameter is documented in the package level documentation. The package level documentation is well written and would have answered my question, but it is currently very difficult to find. Part of the problem is that it is within a paragraph so it is not easy to just browse to it and searching the page for 'n' is also not efficient.
Two solutions that come to mind are documenting the parameter on the functions that use it or maybe just renaming it to something searchable like
count
.The text was updated successfully, but these errors were encountered: