Source file test/fixedbugs/issue31987.go
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 7 package main 8 9 import "fmt" 10 11 type container struct { 12 Value string 13 } 14 15 func 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