mark2web/pkg/filter/dump.go
Sebastian Frank 0683e327c9
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
fixed pongo module version
2022-02-28 11:43:47 +01:00

13 lines
347 B
Go

package filter
import (
"github.com/davecgh/go-spew/spew"
"github.com/flosch/pongo2/v4"
)
// DumpFilter is a pongo2 filter, which returns a spew.Dump of the input
func DumpFilter(in *pongo2.Value, param *pongo2.Value) (*pongo2.Value, *pongo2.Error) {
dumpString := spew.Sdump(in.Interface())
return pongo2.AsValue(string(dumpString)), nil
}