echo.go 348 B

12345678910111213141516171819202122
  1. package main
  2. import (
  3. "fmt"
  4. )
  5. type echo struct {
  6. }
  7. func (f *echo) Validate(args []interface{}) error{
  8. if len(args) != 1{
  9. return fmt.Errorf("echo function only supports 1 parameter but got %d", len(args))
  10. }
  11. return nil
  12. }
  13. func (f *echo) Exec(args []interface{}) (interface{}, bool) {
  14. result := args[0]
  15. return result, true
  16. }
  17. var Echo echo