diff options
Diffstat (limited to 'src/runtime/testdata/testprogcgo/destructor.go')
-rw-r--r-- | src/runtime/testdata/testprogcgo/destructor.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/runtime/testdata/testprogcgo/destructor.go b/src/runtime/testdata/testprogcgo/destructor.go new file mode 100644 index 0000000..49529f0 --- /dev/null +++ b/src/runtime/testdata/testprogcgo/destructor.go @@ -0,0 +1,23 @@ +// Copyright 2023 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 + +// extern void registerDestructor(); +import "C" + +import "fmt" + +func init() { + register("DestructorCallback", DestructorCallback) +} + +//export GoDestructorCallback +func GoDestructorCallback() { +} + +func DestructorCallback() { + C.registerDestructor() + fmt.Println("OK") +} |