File: short_if.go

package info (click to toggle)
golang-github-thoas-go-funk 0.9.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 504 kB
  • sloc: makefile: 10
file content (8 lines) | stat: -rw-r--r-- 129 bytes parent folder | download
1
2
3
4
5
6
7
8
package funk

func ShortIf(condition bool, a interface{}, b interface{}) interface{} {
	if condition {
		return a
	}
	return b
}