Skip to content

Conversation

@wcs1only
Copy link

ref: #29

This PR does not necessarily solve #29, but it will eliminate the problem for those who have azure-pipeline-go as a compile time dependency, but don't actually end up using it.

When assigning a variable at the module scope like:

var foo = createFunc()

The createFunc() call will be executed when your module is initialized anytime anybody imports your module before main() even gets called. If createFunc() is doing something that might hang or block, a downstream dependency will hang before their own main() even gets called simply by virtue of them taking a compile time dependency on you, whether or not they end up actually using your module or not.

This patch removes this behavior for the default pipelineHTTPClient, instead opting to initialize this once the first time it is needed.

@hibitchbye
Copy link

ricky

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

Successfully merging this pull request may close these issues.

2 participants