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.

Example:

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

Inspection Details

Available in:

GoLand 2023.3

Plugin:

Go Template, 233.SNAPSHOT

Last modified: 13 July 2023