jaypipes / ghw

Go HardWare discovery/inspection library
Apache License 2.0
1.62k stars 174 forks source link

context: detect and report conflicting options #281

Closed ffromani closed 2 years ago

ffromani commented 2 years ago

WithChroot and WithSnapshot conflicts to each other, and the users can get surprising results if they try to use them at the same time.

Now: chroot is expected to be much more popular than snapshots, being the latter useful mostly for tests or offline debug/troubleshoot, but still the code should detect and handle these conflicts.

This is made a bit awkward because the current context pkg API. Once we are free to break compatibility, we can make the flow more linear.

ffromani commented 2 years ago

Thanks @fromanirh! Sorry for the delay in merging this!

It's fine! thank you for reviewing!