Update Go library to r60.
From-SVN: r178910
This commit is contained in:
parent
5548ca3540
commit
adb0401dac
718 changed files with 58911 additions and 30469 deletions
|
@ -212,24 +212,38 @@ func genSplit(s, sep []byte, sepSave, n int) [][]byte {
|
|||
return a[0 : na+1]
|
||||
}
|
||||
|
||||
// Split slices s into subslices separated by sep and returns a slice of
|
||||
// SplitN slices s into subslices separated by sep and returns a slice of
|
||||
// the subslices between those separators.
|
||||
// If sep is empty, SplitN splits after each UTF-8 sequence.
|
||||
// The count determines the number of subslices to return:
|
||||
// n > 0: at most n subslices; the last subslice will be the unsplit remainder.
|
||||
// n == 0: the result is nil (zero subslices)
|
||||
// n < 0: all subslices
|
||||
func SplitN(s, sep []byte, n int) [][]byte { return genSplit(s, sep, 0, n) }
|
||||
|
||||
// SplitAfterN slices s into subslices after each instance of sep and
|
||||
// returns a slice of those subslices.
|
||||
// If sep is empty, SplitAfterN splits after each UTF-8 sequence.
|
||||
// The count determines the number of subslices to return:
|
||||
// n > 0: at most n subslices; the last subslice will be the unsplit remainder.
|
||||
// n == 0: the result is nil (zero subslices)
|
||||
// n < 0: all subslices
|
||||
func SplitAfterN(s, sep []byte, n int) [][]byte {
|
||||
return genSplit(s, sep, len(sep), n)
|
||||
}
|
||||
|
||||
// Split slices s into all subslices separated by sep and returns a slice of
|
||||
// the subslices between those separators.
|
||||
// If sep is empty, Split splits after each UTF-8 sequence.
|
||||
// The count determines the number of subslices to return:
|
||||
// n > 0: at most n subslices; the last subslice will be the unsplit remainder.
|
||||
// n == 0: the result is nil (zero subslices)
|
||||
// n < 0: all subslices
|
||||
func Split(s, sep []byte, n int) [][]byte { return genSplit(s, sep, 0, n) }
|
||||
// It is equivalent to SplitN with a count of -1.
|
||||
func Split(s, sep []byte) [][]byte { return genSplit(s, sep, 0, -1) }
|
||||
|
||||
// SplitAfter slices s into subslices after each instance of sep and
|
||||
// SplitAfter slices s into all subslices after each instance of sep and
|
||||
// returns a slice of those subslices.
|
||||
// If sep is empty, Split splits after each UTF-8 sequence.
|
||||
// The count determines the number of subslices to return:
|
||||
// n > 0: at most n subslices; the last subslice will be the unsplit remainder.
|
||||
// n == 0: the result is nil (zero subslices)
|
||||
// n < 0: all subslices
|
||||
func SplitAfter(s, sep []byte, n int) [][]byte {
|
||||
return genSplit(s, sep, len(sep), n)
|
||||
// If sep is empty, SplitAfter splits after each UTF-8 sequence.
|
||||
// It is equivalent to SplitAfterN with a count of -1.
|
||||
func SplitAfter(s, sep []byte) [][]byte {
|
||||
return genSplit(s, sep, len(sep), -1)
|
||||
}
|
||||
|
||||
// Fields splits the array s around each instance of one or more consecutive white space
|
||||
|
@ -384,7 +398,6 @@ func ToTitleSpecial(_case unicode.SpecialCase, s []byte) []byte {
|
|||
return Map(func(r int) int { return _case.ToTitle(r) }, s)
|
||||
}
|
||||
|
||||
|
||||
// isSeparator reports whether the rune could mark a word boundary.
|
||||
// TODO: update when package unicode captures more of the properties.
|
||||
func isSeparator(rune int) bool {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue