wombat

package module
v0.0.0-...-a56dbdc Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

README

wombat

Sourcegraph GoDoc Build Status codecov rcard License Gitter chat

binding & validation & functional goodies.

implements api defined in v2pro/plz/util package

Example

//go:generate go install github.com/v2pro/wombat/cmd/wombat-codegen
//go:generate $GOPATH/bin/wombat-codegen -pkg github.com/v2pro/wombat/example
func init() {
	generic.Declare(func() {
		plz.Max(int(0))
		plz.Max(float64(0))
		plz.Max(model.User{}, "Score")
	})
}

func Demo_max_min(t *testing.T) {
	should := require.New(t)
	should.Equal(3, plz.Max(1, 3, 2))
	should.Equal(float64(3), plz.Max(1.0, 3.0, 2.0))
	should.Equal(model.User{3}, plz.Max(
		model.User{1}, model.User{3}, model.User{2},
		"Score"))
}

replace github.com/v2pro/wombat/example with your package name.

you need call go generate before compile

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Float32 = reflect.TypeOf(float32(0))
View Source
var Float64 = reflect.TypeOf(float64(0))
View Source
var Int = reflect.TypeOf(int(0))
View Source
var Int16 = reflect.TypeOf(int16(0))
View Source
var Int32 = reflect.TypeOf(int32(0))
View Source
var Int64 = reflect.TypeOf(int64(0))
View Source
var Int8 = reflect.TypeOf(int8(0))
View Source
var String = reflect.TypeOf("")
View Source
var Uint = reflect.TypeOf(uint(0))
View Source
var Uint16 = reflect.TypeOf(uint16(0))
View Source
var Uint32 = reflect.TypeOf(uint32(0))
View Source
var Uint64 = reflect.TypeOf(uint64(0))
View Source
var Uint8 = reflect.TypeOf(uint8(0))

Functions

func Codegen

func Codegen(pkgPath string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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