gitlab.com/evatix-go/core@v1.3.55/issetter/GetSetterByComparing.go (about)

     1  package issetter
     2  
     3  // GetSetterByComparing
     4  //
     5  // returns true value if any of ranges value matches
     6  func GetSetterByComparing(
     7  	trueVal, falseVal Value,
     8  	expectedVal interface{},
     9  	trueRanges ...interface{},
    10  ) Value {
    11  	for _, s := range trueRanges {
    12  		if s == expectedVal {
    13  			return trueVal
    14  		}
    15  	}
    16  
    17  	return falseVal
    18  }