check

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2018 License: Apache-2.0 Imports: 3 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dir

func Dir(path string) error

Dir checks the given path, will return error if path not exists or path is not directory.

func ErrorForExit

func ErrorForExit(name string, err error, code ...int)

ErrorForExit check the error. If error is not nil, print the error message and exit the application. If error is nil, do nothing.

func HostAndPort

func HostAndPort(hostAndPort string) bool

HostAndPort checks whether a string contains host and port. It returns true if matched.

func Int32SliceContains

func Int32SliceContains(slice []int32, target int32) bool

Int32SliceContains iterates over the slice to find the target.

func Int64SliceContains

func Int64SliceContains(slice []int64, target int64) bool

Int64SliceContains iterates over the slice to find the target.

func IntSliceContains

func IntSliceContains(slice []int, target int) bool

IntSliceContains iterates over the slice to find the target.

func StringSliceContains

func StringSliceContains(slice []string, target string) bool

StringSliceContains iterates over the slice to find the target.

Types

type ReadableError

type ReadableError struct {
	Message string
}

ReadableError is just a structure contains readable message that can be returned directly to end user.

func NewReadableError

func NewReadableError(message string) ReadableError

NewReadableError creates a ReadableError{} from given message.

func (ReadableError) Error

func (e ReadableError) Error() string

Error returns the description of ReadableError.

Jump to

Keyboard shortcuts

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