Go support for programmers familiar with other common programming languages, such as C/C++, Java, Javascript, Python.
Cond(a, b, c): Conditional operatora ? b : cNull(a, b): Nil-checking operatora ?? bi. e.a!=nil ? a : bValue(value, error): Returns the error if so, value if not.- Case to Boolean type:
Bool(v)- Numbers: whether
vis non-zero; - Strings: whether
vis non-empty; nil-Testible Objects viz. pointer, channel, function, interface, map, and slice types:niltofalse, others totrue;- Arrays and structures: always true as for JavaScript empty array
[]and empty object{}.
- Numbers: whether