status-go/vendor/github.com/mattn/go-pointer
Richard Ramos a9a87f39e5 chore: upgrade deps 2022-11-09 17:39:17 +03:00
..
_example chore: upgrade deps 2022-11-09 17:39:17 +03:00
LICENSE chore: upgrade deps 2022-11-09 17:39:17 +03:00
README.md chore: upgrade deps 2022-11-09 17:39:17 +03:00
doc.go chore: upgrade deps 2022-11-09 17:39:17 +03:00
pointer.go chore: upgrade deps 2022-11-09 17:39:17 +03:00

README.md

go-pointer

Utility for cgo

Usage

https://github.com/golang/proposal/blob/master/design/12416-cgo-pointers.md

In go 1.6, cgo argument can't be passed Go pointer.

var s string
C.pass_pointer(pointer.Save(&s))
v := *(pointer.Restore(C.get_from_pointer()).(*string))

Installation

go get github.com/mattn/go-pointer

License

MIT

Author

Yasuhiro Matsumoto (a.k.a mattn)