Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ZeroAsNull ¶
Example (Int64) ¶
var a int64 a = 3 fmt.Println(ZeroAsNull(a) == int64(3)) fmt.Println(ZeroAsNull(&a) == int64(3)) a = 0 fmt.Println(ZeroAsNull(a) == nil) fmt.Println(ZeroAsNull(&a) == int64(0)) fmt.Println(ZeroAsNull((*int64)(nil)) == nil)
Output: true true true true true
Example (String) ¶
var a string a = "a" fmt.Println(ZeroAsNull(a) == "a") fmt.Println(ZeroAsNull(&a) == "a") a = "" fmt.Println(ZeroAsNull(a) == nil) fmt.Println(ZeroAsNull(&a) == "") fmt.Println(ZeroAsNull((*string)(nil)) == nil)
Output: true true true true true
func ZeroAsNulls ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.