nerdctl: pkg/cmd: inconsistent arguments ordering
Probably options
should be consistently placed in the last.
stdout io.Writer
should be ~probably right after ctx context.Context
(if any).~ put into the options struct, and the nil value should imply os.Stdout
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 16 (16 by maintainers)
No rush! I know it’s holiday now in China 😃. Enjoy your holiday and happy Lunar New Year! 🎉
Yes, we can just put
Stdout io.Writer
to the option struct directly, then we should treat Stdin and Stderr in the same way, and we don’t need theIO
struct“options” should be optional, so I’d prefer
options
to be the last.So my preference is
func Foo(ctx, client, stdin, stdout, stderr, flag0, flag1, flag2, options) error
.We can also reconsider putting everything except ctx into options. (Sorry for going back and forth)