iface

package
v0.23.1 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func If

func If(cond bool, i1, i2 interface{}) interface{}

If returns the first item if cond is true, or the second item if it is false.

func IsNil

func IsNil(i interface{}) bool

IsNil is a safe test for nil for any kind of variable, and will not panic If i points to a nil object, IsNil will return true, as opposed to i==nil which will return false

Example
package main

import (
	"fmt"

	"github.com/goradd/goradd/pkg/iface"
)

func main() {
	fmt.Println(iface.IsNil(nil))
}
Output:

true

Types

This section is empty.

Jump to

Keyboard shortcuts

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