Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsRuneBoundary ¶
IsRuneBoundary checks that `index`-th byte is the first byte in a UTF-8 code point sequence or the end of the string.
The start and end of the string (when `index == len(s)`) are considered to be boundaries.
Returns `false` if `index` is greater than `len(s)`.
Examples ¶
``` ```
Types ¶
type ByteOffsets ¶
type ByteOffsets struct {
// Start byte position, inclusive.
Start int
// End byte position, exclusive.
End int
}
ByteOffsets represents a (start, end) range of byte offset positions.
type BytesToRuneOffsetConverter ¶
type BytesToRuneOffsetConverter struct {
// contains filtered or unexported fields
}
func NewBytesToRuneOffsetConverter ¶
func NewBytesToRuneOffsetConverter(sequence string) *BytesToRuneOffsetConverter
func (*BytesToRuneOffsetConverter) Convert ¶
func (b *BytesToRuneOffsetConverter) Convert(offsets ByteOffsets) RuneOffsets
type RuneOffsets ¶
type RuneOffsets struct {
// Start rune position, inclusive.
Start int
// End rune position, exclusive.
End int
}
RuneOffsets represents a (start, end) range of byte rune positions.
Click to show internal directories.
Click to hide internal directories.