sysutil

package
v0.0.0-...-2f48622 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func As

func As[T constraints.Integer](r1 uintptr, r2 uintptr, err error) T

As returns T(r1) and ignores err.

func AsBool

func AsBool(r1 uintptr, r2 uintptr, err error) bool

AsBool returns whether r1 is not zero and ignores err.

func IsNoError

func IsNoError(err error) bool

IsNoError returns whether err matches(errors.Is) syscall.Error(0). This usually means no error during calling a syscall.

func MustNoError

func MustNoError[T constraints.Integer](r1 uintptr, r2 uintptr, err error) (T, error)

MustNoError returns (r1, nil) if err is(IsNoError) something other than syscall.Errno(0), r1, err otherwise.

func MustNotNegativeOne

func MustNotNegativeOne[T constraints.Signed](r1 uintptr, r2 uintptr, err error) (T, error)

MustNotNegativeOne returns (r1, nil) if r1 is not -1, (r1, err) otherwise.

func MustNotZero

func MustNotZero[T constraints.Integer | ~unsafe.Pointer](r1 uintptr, r2 uintptr, err error) (T, error)

MustNotZero returns (r1, nil) if r1 is not zero, (r1, err) otherwise.

func MustTrue

func MustTrue(r1 uintptr, r2 uintptr, err error) error

MustTrue returns nil if r1 is not 0, err otherwise.

func MustZero

func MustZero[T constraints.Integer](r1 uintptr, r2 uintptr, err error) error

MustZero returns nil if r1 is 0, err otherwise.

Types

This section is empty.

Jump to

Keyboard shortcuts

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