gitlab.com/evatix-go/core@v1.3.55/conditional/InterfaceFunc.go (about)

     1  package conditional
     2  
     3  func InterfaceFunc(
     4  	isTrue bool,
     5  	trueValueFunc, falseValueFunc func() interface{},
     6  ) interface{} {
     7  	if isTrue {
     8  		return trueValueFunc()
     9  	}
    10  
    11  	return falseValueFunc()
    12  }