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
Labels
Milestone

Comments

@yur4uj
Copy link

@yur4uj 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
@gopherbot gopherbot added the Proposal label Jun 10, 2020
@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Jun 10, 2020

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

@yur4uj
Copy link
Author

@yur4uj 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

@ianlancetaylor ianlancetaylor commented Jun 11, 2020

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 Jun 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.