golang-plugins

command module
v0.0.0-...-f67c371 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

README

golang-plugins

golang-plugins uses the new plugin feature of Go 1.8 to implement hot code swapping in Go.

This is highly experimental and just a way for me to learn how plugins work and what limitations I find.

Run this program and then try editing, adding, or removing files in the plugins directory.

go run main.go

The entry point to the plugins is the Run function, that doesn't receive any parameters and returns an error.

Limitations:

  • This only works on Linux.
  • We poll regularly the plugins directory instead of using fsnotify.
  • We recompile every time, even if the code has not changed.
  • This causes a continuously growing memory requirement (memory leak?).
Disclaimer

This is not an official Google product (experimental or otherwise), it is just code that happens to be owned by Google.

Documentation

Overview

golang-plugins uses the new plugin feature of Go 1.8 to implement hot code swapping in Go. This is highly experimental and just a way for me to learn how plugins work and what limitations I find.

Limitations:

This only works on Linux. We poll regularly the plugins directory instead of using fsnotify. We recompile every time, even if the code has not changed. This causes a continuously growing memory requirement (memory leak?).

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL