mirror of
https://github.com/MontFerret/ferret.git
synced 2024-12-18 23:47:48 +02:00
17 lines
328 B
Go
17 lines
328 B
Go
|
package core
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"fmt"
|
||
|
)
|
||
|
|
||
|
type Function = func(ctx context.Context, args ...Value) (Value, error)
|
||
|
|
||
|
func ValidateArgs(inputs []Value, required int) error {
|
||
|
if len(inputs) != required {
|
||
|
return Error(ErrMissedArgument, fmt.Sprintf("expected %d, but got %d arguments", required, len(inputs)))
|
||
|
}
|
||
|
|
||
|
return nil
|
||
|
}
|