title: InvalidLitIndex layout: article

InvalidLitIndex occurs when the key in a key-value element of a slice or
array literal is not an integer constant.

Example:
 var i = 0
 var x = []string{i: "world"}