]> Cypherpunks repositories - gostls13.git/commitdiff
regexp: name result parameters referenced from docs
authorBrad Fitzpatrick <bradfitz@golang.org>
Thu, 9 Feb 2012 23:22:01 +0000 (10:22 +1100)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 9 Feb 2012 23:22:01 +0000 (10:22 +1100)
Fixes #2953

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5653051

src/pkg/regexp/regexp.go

index d12ff0275984a758251abbe0d9bd94d966c86b4d..54c53776cf7adbb9ab8e97cac2bf35fad55621fb 100644 (file)
@@ -676,7 +676,7 @@ func (re *Regexp) FindString(s string) string {
 // location of the leftmost match in s of the regular expression.  The match
 // itself is at s[loc[0]:loc[1]].
 // A return value of nil indicates no match.
-func (re *Regexp) FindStringIndex(s string) []int {
+func (re *Regexp) FindStringIndex(s string) (loc []int) {
        a := re.doExecute(nil, nil, s, 0, 2)
        if a == nil {
                return nil
@@ -688,7 +688,7 @@ func (re *Regexp) FindStringIndex(s string) []int {
 // location of the leftmost match of the regular expression in text read from
 // the RuneReader.  The match itself is at s[loc[0]:loc[1]].  A return
 // value of nil indicates no match.
-func (re *Regexp) FindReaderIndex(r io.RuneReader) []int {
+func (re *Regexp) FindReaderIndex(r io.RuneReader) (loc []int) {
        a := re.doExecute(r, nil, "", 0, 2)
        if a == nil {
                return nil