mirror of
https://github.com/danog/liquid.git
synced 2024-12-11 16:09:37 +01:00
16 lines
294 B
Go
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
|
|
}
|
|
}
|