diff --git a/pipeline.go b/pipeline.go index d3cb8ed..75c8f7d 100644 --- a/pipeline.go +++ b/pipeline.go @@ -3,6 +3,7 @@ package jobs import ( "encoding/json" "strconv" + "math" "unsafe" ) @@ -90,12 +91,17 @@ func (p Pipeline) Int(name string, d int) int { switch v := value.(type) { // the most probable case case string: - res, err := strconv.ParseInt(v, 10, 64) + res, err := strconv.ParseInt(v, 10, 32) if err != nil { // return default on failure return d } + if res > math.MaxInt32 || res < math.MinInt32 { + // return default if out of bounds + return d + } + return int(res) case int: return v