1
0
mirror of https://github.com/danog/liquid.git synced 2024-11-26 23:24:38 +01:00
liquid/expressions/drops.go
2017-07-13 20:18:23 -04:00

16 lines
296 B
Go

package expressions
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
}
}