diff options
| author | Jeff Carr <[email protected]> | 2023-05-09 20:25:37 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2023-05-09 20:25:37 -0500 |
| commit | 26b06253d540fbcac2ae1372aa7fc0b1089bab98 (patch) | |
| tree | 9afc2600ce0633e85990f8376091d93fec7c6d3a /toolkit/andlabs/process.go | |
| parent | 45ef7f37c4af0495ccf988f2f726aaea24a999e4 (diff) | |
more code cleanups
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'toolkit/andlabs/process.go')
| -rw-r--r-- | toolkit/andlabs/process.go | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/toolkit/andlabs/process.go b/toolkit/andlabs/process.go deleted file mode 100644 index d70877e..0000000 --- a/toolkit/andlabs/process.go +++ /dev/null @@ -1,72 +0,0 @@ -// myplugin/myplugin.go -package main - -/* -from chatgpt: - -// put this in widget.go -import ( - "fmt" - // "toolkit" -) - -type Plugin interface { - Process(input chan string, output chan string) -} - -// put this in wit/gui/toolkit/* -type myPlugin struct{} - -var Plugin myPlugin - -func (p *myPlugin) Process(input chan string, output chan string) { - go func() { - for msg := range input { - // Your processing logic goes here - result := fmt.Sprintf("Processed: %s", msg) - output <- result - } - }() -} - -// main.go put this in wit/gui -package main - -import ( - "fmt" - "plugin" - "pluginapi" -) - -func main() { - plug, err := plugin.Open("myplugin.so") - if err != nil { - panic(err) - } - - symPlugin, err := plug.Lookup("Plugin") - if err != nil { - panic(err) - } - - p, ok := symPlugin.(pluginapi.Plugin) - if !ok { - panic("Invalid plugin type") - } - - input := make(chan string) - output := make(chan string) - - p.Process(input, output) - - input <- "Hello, World!" - close(input) - - for result := range output { - fmt.Println(result) - } -} - -*/ - -// func main() {} |
