Skip to content

CDFN/conditionally-execute

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

Releases

No releases published

Packages

No packages published

Languages