mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-11 15:36:37 +00:00
Check for nil strings and include wrappers around each.
Signed-off-by: matt durham <mattdurham@ppog.org>
This commit is contained in:
@@ -12,3 +12,11 @@ func BoolToFloat(b bool) float64 {
|
||||
}
|
||||
return 0.0
|
||||
}
|
||||
|
||||
func HasValue(v *string) bool {
|
||||
return !IsEmpty(v)
|
||||
}
|
||||
|
||||
func IsEmpty(v *string) bool {
|
||||
return v == nil || *v == ""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user