aws / ec2-macos-init

EC2 macOS Init is the launch daemon used to initialize Mac instances within EC2.
https://aws.amazon.com/ec2/instance-types/mac/
Apache License 2.0
148 stars 19 forks source link

fix: detect module even when false is set #37

Closed jahkeup closed 11 months ago

jahkeup commented 1 year ago

Issue #, if available:

Description of changes:

This was tripping up on false being a zero value. When comparing (with cmp) against the zero value of the struct, the desired value is confused with the zero value.

Now the module uses a pointer to detect whether or not a value has been set to handle the case that false is the intended setting.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

jahkeup commented 1 year ago

Added test cases for all of enabled/disabled/unspecified settings.