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

View as plain text