R004warning

Index into nil

A template indexed a slice or map that was nil.

Instead of panicking, the expression gives the zero value and this warning is recorded.

Make sure the slice or map is set before it is indexed, or check it first.

$ piko explain R004

Build output ends each diagnostic with a link to this page, and editors using the Piko language server link the code under the squiggle. Look for CodeNilIndexAccess in Piko's source to see where it is reported.