check

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 11, 2023 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesRange

func BytesRange(length uint, startIdx, endIdx int) error

BytesRange checks if starting index `startIdx`, ending index `endIdx` and len(b) passes sanity checks: * 0 <= startIdx * startIdx <= endIdx * endIdx < len(b)

Types

type ErrEndGreaterThanLength

type ErrEndGreaterThanLength struct {
	Length uint
	EndIdx int
}

ErrEndGreaterThanLength means `endIdx` is greater or equal to the length.

func (*ErrEndGreaterThanLength) Error

func (err *ErrEndGreaterThanLength) Error() string

type ErrEndLessThanStart

type ErrEndLessThanStart struct {
	StartIdx int
	EndIdx   int
}

ErrEndLessThanStart means `endIdx` value is less than `startIdx` value

func (*ErrEndLessThanStart) Error

func (err *ErrEndLessThanStart) Error() string

type ErrStartLessThanZero

type ErrStartLessThanZero struct {
	StartIdx int
}

ErrStartLessThanZero means `startIdx` has negative value

func (*ErrStartLessThanZero) Error

func (err *ErrStartLessThanZero) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL