MCPcopy Index your code
hub / github.com/go-task/task / Valid

Method Valid

experiments/experiment.go:46–60  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

44}
45
46func (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
62func (x Experiment) String() string {
63 if x.Enabled() {

Callers 2

TestNewFunction · 0.80
ValidateFunction · 0.80

Calls 2

ActiveMethod · 0.95
EnabledMethod · 0.95

Tested by 1

TestNewFunction · 0.64