util

package
v0.0.0-...-19bcc65 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: AGPL-3.0 Imports: 9 Imported by: 5

Documentation

Index

Constants

View Source
const BinSize int = 2

Variables

View Source
var ErrNoFunctionName = errors.New("no function name")

Functions

func CheckArgumentCount

func CheckArgumentCount(args []string, expected int) error

func DrawWatermark

func DrawWatermark(text []string, draw func(string))

func FindAllByteOccurrences

func FindAllByteOccurrences(data []byte, pattern []byte) []int

func GetStringFromBytes

func GetStringFromBytes(data []byte, start, end int) string

func HexStringToBytes

func HexStringToBytes(hexStr string) ([]byte, error)

func MapKeyValuePairs

func MapKeyValuePairs(lines []string) (map[string]string, error)

func MoveEntry

func MoveEntry[T comparable](slice []T, entry T, newIndex int) []T

func NewCommand

func NewCommand(args []string, name string, argCount int) ([]string, error)

func ReplaceByteOccurrences

func ReplaceByteOccurrences(original []byte, expectedBytes []byte, replacement []byte, occurrenceToReplace int) []byte

func SplitArguments

func SplitArguments(input string) []string

func StringToBytes

func StringToBytes(input string) []byte

func WrapError

func WrapError(a func() (string, error)) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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