9 lines
107 B
Go
9 lines
107 B
Go
package main
|
|
|
|
func If[T any](cond bool, vtrue, vfalse T) T {
|
|
if cond {
|
|
return vtrue
|
|
}
|
|
return vfalse
|
|
}
|