Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>Update:</strong> It is now possible do do this in mainline Go, see <a href="https://docs.google.com/document/d/1nr-TQHw_er6GOQRsF6T43GGhFDelrAP0NqSS_00RgZQ/edit" rel="nofollow noreferrer">Go Execution Modes</a></p> <p>From the <a href="https://golang.org/doc/go1.5" rel="nofollow noreferrer">Go 1.5 release notes</a>:</p> <blockquote> <p>For the amd64 architecture only, the compiler has a new option, -dynlink, that assists dynamic linking by supporting references to Go symbols defined in external shared libraries.</p> </blockquote> <p><strong>Old Answer</strong> (<em>useful discussion of other options</em>): </p> <p>It is not currently possible to create dynamically linked libraries* in main line Go. There has been some talk about this, so you may see support in the future. However, there is a 3rd party go project called <a href="https://github.com/eliasnaur/goandroid" rel="nofollow noreferrer">goandriod</a> that needed the same functionality you need, so they maintain patches that should allow you to patch the official Go code base to support the dynamic linked support you are requesting.</p> <p>If you want to use a the standard Go run-time, I would recommend the one of the following. Invoke your Go program from your other program, and communicate using:</p> <ol> <li>Pipes to communicate</li> <li>A UNIX domain socket</li> <li>A mmaped region of shared memory. <ol> <li>That is create a file on /dev/shm and have both programs mmap it.</li> <li>Go mmap library: <a href="https://github.com/edsrzf/mmap-go" rel="nofollow noreferrer">https://github.com/edsrzf/mmap-go</a></li> </ol></li> </ol> <p>Each consecutive option will take more effort to setup, be more platform specific, but potentially be more powerful than the previous one.</p> <p><strong>*Note:</strong> That is DLLs in the Windows world, and .so files in the UNIX/Linux world.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload