diff options
author | bep <bjorn.erik.pedersen@gmail.com> | 2015-03-18 11:10:04 +0100 |
---|---|---|
committer | bep <bjorn.erik.pedersen@gmail.com> | 2015-03-18 11:30:37 +0100 |
commit | e39a258ec409f7072e82342bb50e8ac2ed15a994 (patch) | |
tree | f48e0ab416729d5d194878011e37d3d832f36711 /helpers/general.go | |
parent | b3bd71fec90ea2680a68d28e7ac5e82f80eafdde (diff) |
Improve type handling in Seq
Diffstat (limited to 'helpers/general.go')
-rw-r--r-- | helpers/general.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/helpers/general.go b/helpers/general.go index a218cbd5d..f7ff3381d 100644 --- a/helpers/general.go +++ b/helpers/general.go @@ -175,6 +175,10 @@ func Seq(args ...interface{}) ([]int, error) { intArgs := cast.ToIntSlice(args) + if len(intArgs) < 1 || len(intArgs) > 3 { + return nil, errors.New("Invalid argument(s) to Seq") + } + var inc int = 1 var last int var first = intArgs[0] |