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
- Host: GitHub
- URL: https://github.com/cdfn/conditionally-execute
- Owner: CDFN
- Created: 2020-04-29T16:51:54.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-01-20T12:56:30.000Z (almost 5 years ago)
- Last Synced: 2025-03-24T15:41:45.361Z (10 months ago)
- Topics: go, useless-things
- Language: Go
- Size: 1.95 KB
- Stars: 5
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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!".