github.com/flyinox/gosm@v0.0.0-20171117061539-16768cb62077/misc/cgo/testplugin/src/plugin2/plugin2.go (about)

     1  // Copyright 2016 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package main
     6  
     7  //#include <errno.h>
     8  //#include <string.h>
     9  import "C"
    10  
    11  // #include
    12  // void cfunc() {} // uses cgo_topofstack
    13  
    14  import (
    15  	"common"
    16  	"strings"
    17  )
    18  
    19  func init() {
    20  	_ = strings.NewReplacer() // trigger stack unwind, Issue #18190.
    21  	C.strerror(C.EIO)         // uses cgo_topofstack
    22  	common.X = 2
    23  }
    24  
    25  func main() {
    26  	panic("plugin1.main called")
    27  }