On Wed, Nov 8, 2017 at 9:41 AM, jhallock via golang-nuts <golang-nuts@googlegroups.com> wrote: > > I've seen that Go can call C++ functions using SWIG, but can C++ call Go > functions? > > I work on a data service written in C++ with an internal validation library. > We'd like to allow our users to contribute and manage the validation rules > themselves. We can assume they know Go, but not C++.
Yes, C++ can call Go functions. It can be done using a C API via the cgo //export mechanism. Or it can be done using SWIG by using a director class. There is an example of the latter in misc/swig/callback in the Go distribution. Ian -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.