An open API service indexing awesome lists of open source software.

https://github.com/cdfn/conditionally-execute

Lets you abandon if keyword. Go port of https://github.com/bopke/conditionally-execute
https://github.com/cdfn/conditionally-execute

go useless-things

Last synced: 9 months ago
JSON representation

Lets you abandon if keyword. Go port of https://github.com/bopke/conditionally-execute

Awesome Lists containing this project

README

          

# conditionally-execute-go
conditionally-execute-go is Go port of [conditionally-execute](https://github.com/bopke/conditionally-execute) by [@bopke](https://github.com/bopke).
It lets you abandon `if` keyword
### Usage:
```go
condition := false
ce := condexec.New(condition).OnFalse(func() {
log.Println("Hey, condition is false!")
}).OnTrue(func() {
log.Println("Hey, condition is true!")
}).Execute()
```
Code above will obviously print "Hey, condition is false!".