xcondition

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2021 License: MIT Imports: 0 Imported by: 5

README

xcondition

Dependencies

  • xtesting*

Documents

Types
  • None
Variables
  • None
Constants
  • None
Functions
  • func IfThen(condition bool, value1 interface{}) interface{}
  • func IfThenElse(condition bool, value1 interface{}, value2 interface{}) interface{}
  • func DefaultIfNil(value interface{}, defaultValue interface{}) interface{}
  • func PanicIfErr(i interface{}, err error) interface{}
  • func FirstNotNil(values ...interface{}) interface{}
  • func First(args ...interface{}) interface{}
  • func Second(args ...interface{}) interface{}
  • func Third(args ...interface{}) interface{}
  • func Last(args ...interface{}) interface{}
Methods
  • None

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultIfNil

func DefaultIfNil(value, defaultValue interface{}) interface{}

DefaultIfNil returns value if it is not nil, otherwise returns defaultValue.

func First

func First(args ...interface{}) interface{}

First returns the first element of args, panics if out of range.

func FirstNotNil

func FirstNotNil(values ...interface{}) interface{}

FirstNotNil returns the first value which is not nil.

func IfThen

func IfThen(condition bool, value interface{}) interface{}

IfThen returns value if condition is true, otherwise returns nil.

func IfThenElse

func IfThenElse(condition bool, value1, value2 interface{}) interface{}

IfThenElse returns value1 if condition is true, otherwise returns value2.

func Last

func Last(args ...interface{}) interface{}

Last returns the last element of args, panics if out of range.

func PanicIfErr

func PanicIfErr(value interface{}, err error) interface{}

PanicIfErr returns value if err is nil, otherwise panics with error message.

func Second

func Second(args ...interface{}) interface{}

Second returns the second element of args, panics if out of range.

func Third

func Third(args ...interface{}) interface{}

Third returns the third element of args, panics if out of range.

Types

This section is empty.

Jump to

Keyboard shortcuts

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