Go Nil: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
(Created page with "=Internal= * Go Language =Overview=")
 
 
(One intermediate revision by the same user not shown)
Line 2: Line 2:
* [[Go Language]]
* [[Go Language]]
=Overview=
=Overview=
<code>nil</code> is the Go [[Go_Language#Pre-Declared_Zero_Value|pre-declared zero value]].
=<tt>nil</tt> Test=
<syntaxhighlight lang='go'>
if v == nil {
  // ...
}
if v != nil {
  // ...
}
</syntaxhighlight>

Latest revision as of 00:55, 23 August 2023

Internal

Overview

nil is the Go pre-declared zero value.

nil Test

if v == nil {
  // ...
}

if v != nil {
  // ...
}