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 ( 10 "reflect" 11) 12 13var x = struct{ a, _, c int }{1, 2, 3} 14 15func main() { 16 if i := reflect.ValueOf(x).Field(1).Int(); i != 0 { 17 println("got", i, "want", 0) 18 panic("fail") 19 } 20} 21