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

stdout is polluted before handshake #164

Closed
vitrun opened this issue Dec 21, 2020 · 1 comment
Closed

stdout is polluted before handshake #164

vitrun opened this issue Dec 21, 2020 · 1 comment

Comments

@vitrun
Copy link

vitrun commented Dec 21, 2020

Hi,
Go-plugin relies on stdout to handshake, however, stdout is likely to be polluted by other modules inited before go-plugin. For example, in module A:

func init() {
fmt.Println("Hey, this happens before init of go-plugin")
}

As for handshake, do we have alternatives to stdout?

@mitchellh
Copy link
Contributor

mitchellh commented Dec 21, 2020

I would challenge it isn't "likely to be polluted" since we've used go-plugin in a number of projects with hundreds of transitive Go dependencies and have never once had an issue. I'd argue its fairly hostile for anything to output to stdout in an init function. 😄

There are no plans currently to use anything other than stdout for the handshake. There have been requests to enable some functionality of redirecting stdout after the handshake but so far we've been against that as well (to just keep it flexible for how we modify the handshake in the future).

I'd recommend if you need non-stdout support that you fork the project for your needs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants