pkg

package
v0.2.56 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Caller = &_Caller{}

Caller init

View Source
var ErrNoFuncCaller = errors.New("pkg: no func caller error")

ErrNoFuncCaller not found error

Functions

func Default

func Default(t, f interface{}) interface{}

func If

func If(b bool, t, f interface{}) interface{}

If exported

func IsNone

func IsNone(val interface{}) bool

IsNone exported

func IsZero

func IsZero(val reflect.Value) bool

IsZero exported

func LCS

func LCS(s1 string, s2 string) string

LCS gets the longest common substring of s1 and s2. 最长公共子串 Refers to http://en.wikibooks.org/wiki/Algorithm_Implementation/Strings/Longest_common_substring.

Types

type Pipeline

type Pipeline func(...interface{}) error

Pipeline is the func type for the pipeline result.

func Pipe

func Pipe(fs ...interface{}) Pipeline

Pipe accepts zero or more funcs fs and creates a pipeline.

A pipeline syncs outputs and inputs of consequent funcs together, such that the output of i'th func is the input of (i+1)'th func. Each func can accept zero or one input argument and return zero or one value with an optional error.

The last func is called a sink which only accepts an input argument and returns no value except an optional error; unless its return value will be ignored.

If a func in the pipeline fails with an error during the invocation, the pipe is broken immediately and the invocation returns an error.

Directories

Path Synopsis
Package null contains SQL types that consider zero input and null input as separate values, with convenient support for JSON and text marshaling.
Package null contains SQL types that consider zero input and null input as separate values, with convenient support for JSON and text marshaling.
Package structs contains various utilities functions to work with structs.
Package structs contains various utilities functions to work with structs.
Package table provides a convenient way to generate tabular output of any data, primarily useful for CLI tools.
Package table provides a convenient way to generate tabular output of any data, primarily useful for CLI tools.
Package now is a time toolkit for golang.
Package now is a time toolkit for golang.

Jump to

Keyboard shortcuts

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