Skip to content

Commit

Permalink
[FFM-3441]: Unable to evaluate JSON multivariate (#82)
Browse files Browse the repository at this point in the history
This change ensures we handle JSON types when evaluating with pre-reqs.

Multivariate flags can contain JSON.  This was missed from the current switch
block.
  • Loading branch information
davejohnston authored May 19, 2022
1 parent 25509a7 commit dae2d0c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion evaluation/feature.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,10 @@ func (fc FeatureConfig) EvaluateWithPreReqFlags(target *Target, prereqFlags map[
reflect.Uint32, reflect.Uint64, reflect.Uint8:
fallthrough
case reflect.Float64, reflect.Float32:
fallthrough
case reflect.Map:
variation, err = getVariationWithPrereqs(fc, target, prereqFlags)
case reflect.Map, reflect.Array, reflect.Chan, reflect.Complex128, reflect.Complex64, reflect.Func, reflect.Interface,
case reflect.Array, reflect.Chan, reflect.Complex128, reflect.Complex64, reflect.Func, reflect.Interface,
reflect.Invalid, reflect.Ptr, reflect.Slice, reflect.Struct, reflect.Uintptr, reflect.UnsafePointer:
err = fmt.Errorf("unexpected type: %s for flag %s", fc.GetKind().String(), fc.Feature)
}
Expand Down

0 comments on commit dae2d0c

Please sign in to comment.