R005warning

Index out of range

A template indexed a slice outside its length.

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

Check the length first, such as p-if="len(state.Items) > 2", or loop over the slice with p-for.

$ piko explain R005

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 CodeIndexOutOfBounds in Piko's source to see where it is reported.