Skip to content

Latest commit

 

History

History
13 lines (13 loc) · 476 Bytes

README.md

File metadata and controls

13 lines (13 loc) · 476 Bytes

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