-
Notifications
You must be signed in to change notification settings - Fork 43
chore: refactor options to separate package #278
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest skipping the pkg
prefix, otherwise LGTM. 👍🏻 We already have some packages, like devcontainer
that would make sense to have on the same level IMO.
Fair enough. I only chose |
True, it's not totally uncommon, but it's a bit controversial. Also considered "legacy" https://x.com/bradfitz/status/1039512487538970624 by some 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change itself LGTM, but would like to understand the reasons behind 👍
@@ -83,68 +84,68 @@ type DockerConfig configfile.ConfigFile | |||
// Logger is the logf to use for all operations. | |||
// Filesystem is the filesystem to use for all operations. | |||
// Defaults to the host filesystem. | |||
func Run(ctx context.Context, options Options) error { | |||
func Run(ctx context.Context, opts options.Options) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you justify why we need this change in the PR description? Not sure if having a package just for options isn't an antipattern in Go. It smells more like Java...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When we import this from a separate repo I'd rather not have to import the whole of envbuilder and instead only the things we need.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is opinionated, but this could land in /pkg/api
.
(cherry picked from commit b272a97)
Part of coder/internal#11
Extracts Options to its own package to support easier importing from separate repositories.