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.
Click to show internal directories.
Click to hide internal directories.