()
| 44 | } |
| 45 | |
| 46 | func (x Experiment) Valid() error { |
| 47 | if !x.Active() && x.Value != 0 { |
| 48 | return &InactiveError{ |
| 49 | Name: x.Name, |
| 50 | } |
| 51 | } |
| 52 | if !x.Enabled() && x.Value != 0 { |
| 53 | return &InvalidValueError{ |
| 54 | Name: x.Name, |
| 55 | AllowedValues: x.AllowedValues, |
| 56 | Value: x.Value, |
| 57 | } |
| 58 | } |
| 59 | return nil |
| 60 | } |
| 61 | |
| 62 | func (x Experiment) String() string { |
| 63 | if x.Enabled() { |