From eb2d1cdd1bbc1912e316040f8ef9a363511d3747 Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Thu, 21 Feb 2019 17:38:53 -0500 Subject: misc/cgo/testplugin: convert test.bash to Go and fix in module mode Updates #30228 Updates #28387 Change-Id: Iad7d960b70221f90ccc2372bb1d4d41cec3926e4 Reviewed-on: https://go-review.googlesource.com/c/163214 Run-TryBot: Bryan C. Mills TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- misc/cgo/testplugin/src/plugin2/plugin2.go | 43 ------------------------------ 1 file changed, 43 deletions(-) delete mode 100644 misc/cgo/testplugin/src/plugin2/plugin2.go (limited to 'misc/cgo/testplugin/src/plugin2/plugin2.go') diff --git a/misc/cgo/testplugin/src/plugin2/plugin2.go b/misc/cgo/testplugin/src/plugin2/plugin2.go deleted file mode 100644 index a67f2de27a..0000000000 --- a/misc/cgo/testplugin/src/plugin2/plugin2.go +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package main - -//#include -//#include -import "C" - -// #include -// void cfunc() {} // uses cgo_topofstack - -import ( - "common" - "reflect" - "strings" -) - -func init() { - _ = strings.NewReplacer() // trigger stack unwind, Issue #18190. - C.strerror(C.EIO) // uses cgo_topofstack - common.X = 2 -} - -type sameNameReusedInPlugins struct { - X string -} - -type sameNameHolder struct { - F *sameNameReusedInPlugins -} - -func UnexportedNameReuse() { - h := sameNameHolder{} - v := reflect.ValueOf(&h).Elem().Field(0) - newval := reflect.New(v.Type().Elem()) - v.Set(newval) -} - -func main() { - panic("plugin1.main called") -} -- cgit v1.3