1
0
mirror of https://github.com/danog/liquid.git synced 2024-12-02 18:17:50 +01:00
liquid/expressions/drops.go

16 lines
296 B
Go
Raw Normal View History

2017-07-14 02:18:23 +02:00
package expressions
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
}
}