mirror of
https://github.com/dolthub/dolt.git
synced 2026-01-31 03:18:43 -06:00
27 lines
481 B
Go
27 lines
481 B
Go
package gen
|
|
|
|
import (
|
|
"github.com/clipperhouse/typewriter"
|
|
)
|
|
|
|
func init() {
|
|
templates = append(templates, &typewriter.Template{
|
|
Name: "value",
|
|
Text: `
|
|
func (self {{.Name}}) Equals(other Value) bool {
|
|
if other, ok := other.({{.Name}}); ok {
|
|
return self == other
|
|
} else {
|
|
return false
|
|
}
|
|
}
|
|
|
|
func (v {{.Name}}) Ref() ref.Ref {
|
|
Chk.NotNil(Reffer, "Somebody forgot to call SetReffer")
|
|
return Reffer(v)
|
|
}
|
|
`,
|
|
TypeConstraint: typewriter.Constraint{Comparable: true},
|
|
})
|
|
}
|