In places where we panic when receiving an unexpected enum, the most correct implementation alternative I found was compile-time safety for enums in Go.
Areas of interest for testing
- Osquery log publishing
- Tables:
- kolide_plist
- kolide_json
- kolide_jsonl
- kolide_jwt
- kolide_xml
- kolide_ini
- kolide_nmcli_wifi (Linux)
Don't panic
![image](https://github.com/kolide/launcher/assets/8119675/c7ab79a0-f6da-4477-bdf4-60b7174f2990)
Per discussion here https://github.com/kolide/launcher/pull/1693#discussion_r1583340281 -- since we no longer allow
os.Exit
andlogutil.Fatal
, we should disallow calls topanic
as well. This PR makes that change.In places where we panic when receiving an unexpected enum, the most correct implementation alternative I found was compile-time safety for enums in Go.
Areas of interest for testing
- Osquery log publishing - Tables: - kolide_plist - kolide_json - kolide_jsonl - kolide_jwt - kolide_xml - kolide_ini - kolide_nmcli_wifi (Linux)Don't panic
![image](https://github.com/kolide/launcher/assets/8119675/c7ab79a0-f6da-4477-bdf4-60b7174f2990)