/conditionally-execute

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

Primary LanguageGo

conditionally-execute-go

conditionally-execute-go is Go port of conditionally-execute by @bopke. It lets you abandon if keyword

Usage:

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!".