core

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DidPanic

func DidPanic(fn func()) (didPanic bool, val any, stack string)

DidPanic returns true if the passed function panicked when executed, the value that was passed to panic, and the stack trace. When function did not panic it returns false and zero values for the other two return arguments.

func IsNil

func IsNil(have any) bool

IsNil returns true if "have" is nil.

func Len

func Len(v any) (length int, ok bool)

Len gets length of x using reflection. Returns (0, false) if impossible.

Can be used for: strings, arrays, slices and channels.

func Same

func Same(want, have any) bool

Same returns true when two generic pointers point to the same memory.

It works with pointers to objects, slices, maps and functions. For arrays, it always returns false.

nolint: cyclop

Types

This section is empty.

Jump to

Keyboard shortcuts

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