Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: create a plugin from byte array. #39508

Closed
yur4uj opened this issue Jun 10, 2020 · 3 comments
Closed

Proposal: create a plugin from byte array. #39508

yur4uj opened this issue Jun 10, 2020 · 3 comments

Comments

@yur4uj
Copy link

yur4uj commented Jun 10, 2020

It would be nice to create a Plugin from general byte array, not only from file system path.

@gopherbot gopherbot added this to the Proposal milestone Jun 10, 2020
@ianlancetaylor
Copy link
Contributor

What does that mean? Can you show an example of how it might work?

@yur4uj
Copy link
Author

yur4uj commented Jun 11, 2020

What does that mean? Can you show an example of how it might work?

For now we could create a plugin with

plugin.Open("/some/path")

But what if we received a plugin from network. We should save it first to filesystem and only than open.

It might work like this

var arr []byte
...
plugin.Open(arr)

Also with this kind of the creation it becomes possible to guarantee data integrity.

@ianlancetaylor
Copy link
Contributor

The way that plugins are currently implemented requires the plugin to be in a separate file. If we added this new feature, it would be implemented by writing the byte array out to a file first. Given that implementation constraint, I'm not sure this is very useful.

@yur4uj yur4uj closed this as completed Jun 12, 2020
@golang golang locked and limited conversation to collaborators Jun 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants