preconditions

package
v1.2.66 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Utility methods to check if state or arguments are correct.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckFromIndexSize

func CheckFromIndexSize(fromIndex, size, length int) int

Checks if the sub-range from {@code fromIndex} (inclusive) to {@code fromIndex + size} (exclusive) is within the bounds of range from {@code 0} (inclusive) to {@code length} (exclusive).

func CheckFromToIndex

func CheckFromToIndex(fromIndex, toIndex, length int) int

CheckFromToIndex checks if the sub-range from {@code fromIndex} (inclusive) to {@code toIndex} (exclusive) is within the bounds of range from {@code 0} (inclusive) to {@code length} (exclusive).

func CheckIndex

func CheckIndex(index, length int) int

CheckIndex checks if the {@code index} is within the bounds of the range from {@code 0} (inclusive) to {@code length} (exclusive).

Types

type ErrorOutOfBound

type ErrorOutOfBound error

Jump to

Keyboard shortcuts

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