assert

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2022 License: MIT Imports: 2 Imported by: 2

README

AtomicGo | assert

Downloads Latest Release Tests Coverage Unit test count Go report


Documentation | Contributing | Code of Conduct


AtomicGo

go get atomicgo.dev/assert

assert

import "atomicgo.dev/assert"

Package assert provides a set of assertion functions.

Index

func Contains

func Contains(a any, b any) bool

Contains returns true if a contains b.

func ContainsAll

func ContainsAll[T any](a T, v []T) bool

ContainsAll returns true if all values are contained in a.

func ContainsAny

func ContainsAny[T any](a T, v []T) bool

ContainsAny returns true if any of the values are contained in a.

func ContainsNone

func ContainsNone[T any](a T, v []T) bool

ContainsNone returns true if none of the values are contained in a.

func Equal

func Equal[T any](a, b T) bool

Equal compares two values and returns true if they are equal.

func Implements

func Implements(a, iface any) bool

Implements returns true if the value implements the interface.

func Kind

func Kind(a any, kind reflect.Kind) bool

Kind returns true if the value is of the given kind.

func Lowercase

func Lowercase(s string) bool

Lowercase returns true if the string is lowercase.

func Nil

func Nil(a any) bool

Nil returns true if the value is nil.

func Number

func Number(a any) bool

Number returns true if the value is a number.

func Panic

func Panic(f func()) (panicked bool)

Panic returns true if the function panics.

func Unique

func Unique[T any](s []T) bool

Unique returns true if the slice contains unique values. Items are considered unique if they are not deep equal.

func Uppercase

func Uppercase(s string) bool

Uppercase returns true if the string is uppercase.

func Zero

func Zero(a any) bool

Zero returns true if the value is the zero value.

Generated by gomarkdoc


AtomicGo.dev  ·  with ❤️ by @MarvinJWendt | MarvinJWendt.com

Documentation

Overview

Package assert provides a set of assertion functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(a any, b any) bool

Contains returns true if a contains b.

func ContainsAll

func ContainsAll[T any](a T, v []T) bool

ContainsAll returns true if all values are contained in a.

func ContainsAny

func ContainsAny[T any](a T, v []T) bool

ContainsAny returns true if any of the values are contained in a.

func ContainsNone

func ContainsNone[T any](a T, v []T) bool

ContainsNone returns true if none of the values are contained in a.

func Equal

func Equal[T any](a, b T) bool

Equal compares two values and returns true if they are equal.

func Implements

func Implements(a, iface any) bool

Implements returns true if the value implements the interface.

func Kind

func Kind(a any, kind reflect.Kind) bool

Kind returns true if the value is of the given kind.

func Lowercase

func Lowercase(s string) bool

Lowercase returns true if the string is lowercase.

func Nil

func Nil(a any) bool

Nil returns true if the value is nil.

func Number

func Number(a any) bool

Number returns true if the value is a number.

func Panic

func Panic(f func()) (panicked bool)

Panic returns true if the function panics.

func Unique

func Unique[T any](s []T) bool

Unique returns true if the slice contains unique values. Items are considered unique if they are not deep equal.

func Uppercase

func Uppercase(s string) bool

Uppercase returns true if the string is uppercase.

func Zero

func Zero(a any) bool

Zero returns true if the value is the zero value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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