1
0
mirror of https://github.com/danog/liquid.git synced 2024-12-02 20:57:47 +01:00
liquid/expression/drops.go

16 lines
295 B
Go
Raw Normal View History

2017-07-04 17:12:40 +02:00
package expression
2017-07-03 18:00:43 +02:00
type drop interface {
ToLiquid() interface{}
}
// ToLiquid converts an object to Liquid, if it implements the Drop interface.
func ToLiquid(value interface{}) interface{} {
switch value := value.(type) {
case drop:
return value.ToLiquid()
default:
return value
}
}