compare

package
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: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ByField = generic.DefineFunc("CompareByField(val1 T, val2 T) int").
	Param("T", "the type of value to compare").
	Param("F", "the field name").
	ImportFunc(ByItself).
	Generators("fieldOf", genFieldOf).
	Source(`
{{ $field := fieldOf .T .F }}
{{ $compare := expand "CompareByItself" "T" $field.Type }}
return {{$compare}}(val1.{{.F}}, val2.{{.F}})`)
View Source
var ByItself = generic.DefineFunc("CompareByItself(val1 T, val2 T) int").
	Param("T", "the type of value to compare").
	Generators("dispatch", dispatch).
	Source(`
{{ $compare := expand (.T|dispatch) "T" .T }}
return {{$compare}}(val1, val2)`)

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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