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

API: improve golang.Default #91

Merged
merged 1 commit into from
Aug 6, 2023
Merged

Conversation

hugelgupf
Copy link
Member

Instead of the clunky

env := golang.Default()
env.CgoEnabled = false
env.GOARCH = ...

Then using &env somewhere like in u-root, we now have a nicer With* API that should allow all this in one line:

env := golang.Default(golang.DisableCGO(), golang.WithGOARCH("arm"))

Instead of the clunky

env := golang.Default()
env.CgoEnabled = false
env.GOARCH = ...

Then using &env somewhere like in u-root, we now have a nicer With* API
that should allow all this in one line:

env := golang.Default(golang.DisableCGO(), golang.WithGOARCH("arm"))

Signed-off-by: Chris Koch <chrisko@google.com>
@hugelgupf hugelgupf merged commit 0f229b1 into u-root:main Aug 6, 2023
2 checks passed
@hugelgupf hugelgupf deleted the environ-ptr branch August 6, 2023 01:14
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.

1 participant