1// run
2
3// Copyright 2019 The Go Authors. All rights reserved.
4// Use of this source code is governed by a BSD-style
5// license that can be found in the LICENSE file.
6
7package main
8
9import "fmt"
10
11type container struct {
12	Value string
13}
14
15func main() {
16	s := []container{
17		7: {Value: "string value"},
18	}
19	if s[7].Value != "string value" {
20		panic(fmt.Errorf("wanted \"string value\", got \"%s\"", s[7].Value))
21	}
22}
23