1// run 2 3// Copyright 2017 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 "fmt" 11 "os" 12) 13 14var ( 15 e interface{} 16 s = struct{ a *int }{} 17 b = e == s 18) 19 20func test(obj interface{}) { 21 if obj != struct{ a *string }{} { 22 } 23} 24 25var x int 26 27func f() [2]string { 28 x++ 29 return [2]string{"abc", "def"} 30} 31 32func main() { 33 var e interface{} = [2]string{"abc", "def"} 34 _ = e == f() 35 if x != 1 { 36 fmt.Println("x=", x) 37 os.Exit(1) 38 } 39} 40