knobs.go 364 B

12345678910111213141516
  1. package kernel
  2. type conditionalCheck func(val1, val2 string) bool
  3. // OSValue represents a tuple, value defined, check function when to apply the value
  4. type OSValue struct {
  5. Value string
  6. CheckFn conditionalCheck
  7. }
  8. func propertyIsValid(val1, val2 string, check conditionalCheck) bool {
  9. if check == nil || check(val1, val2) {
  10. return true
  11. }
  12. return false
  13. }