Skip to content

API: improve golang.Default#91

Merged
hugelgupf merged 1 commit into
u-root:mainfrom
hugelgupf:environ-ptr
Aug 6, 2023
Merged

API: improve golang.Default#91
hugelgupf merged 1 commit into
u-root:mainfrom
hugelgupf:environ-ptr

Conversation

@hugelgupf
Copy link
Copy Markdown
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
@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