mirror of
https://github.com/fleetdm/fleet
synced 2026-05-03 21:38:24 +00:00
12 lines
320 B
Go
12 lines
320 B
Go
|
|
package osquery_utils
|
||
|
|
|
||
|
|
// EmptyToZero Sometimes osquery gives us empty string where we expect an integer.
|
||
|
|
// We change the to "0" so it can be handled by the appropriate string to
|
||
|
|
// integer conversion function, as these will err on ""
|
||
|
|
func EmptyToZero(val string) string {
|
||
|
|
if val == "" {
|
||
|
|
return "0"
|
||
|
|
}
|
||
|
|
return val
|
||
|
|
}
|