Inspectopedia Help

Unknown variable

Reports usages of unknown variables in Go Templates.

Parsing of such templates will cause panic because variables must be declared before usage.


{{$v}} is zero. {{/* bad, $v is unknown */}} {{$v := 0}}{{$v}} is zero. {{/* good */}}

Inspection Details

Available in:

GoLand 2023.3


Go Template, 233.SNAPSHOT

Last modified: 13 July 2023