-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed
Labels
Milestone
Description
I find myself writing this function (or code snippet) far too frequently, one possible option is to implement a turnery function, but that has been turned down before. Assuming this too has not been declined, could some flavour be added to strconv:
func Not(b bool) string {
if b {
return "not "
}
return ""
}I am quite amenable to other names, and there may be a better way to support other languages or functionality:
func When(b bool, s string) string {
if b {
return s
}
return ""
}Reactions are currently unavailable