1
0
mirror of https://github.com/danog/liquid.git synced 2024-11-30 07:18:58 +01:00
liquid/evaluator/drop.go
Oliver Steele 36929af0a6 Coverage
2017-07-05 23:25:03 -04:00

16 lines
294 B
Go

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