chore: release 0.29.0.rc0 (#1600)

This commit is contained in:
Jan-Otto Kröpke
2024-09-11 00:34:10 +02:00
committed by GitHub
parent 83b0aa8f62
commit f712c07c38
119 changed files with 5113 additions and 2255 deletions

View File

@@ -12,14 +12,17 @@ func ExpandEnabledCollectors(enabled string) []string {
expanded := strings.ReplaceAll(enabled, types.DefaultCollectorsPlaceholder, types.DefaultCollectors)
separated := strings.Split(expanded, ",")
unique := map[string]bool{}
for _, s := range separated {
if s != "" {
unique[s] = true
}
}
result := make([]string, 0, len(unique))
for s := range unique {
result = append(result, s)
}
return result
}

View File

@@ -38,13 +38,16 @@ func TestExpandEnabled(t *testing.T) {
success = false
} else {
sort.Strings(testCase.expectedOutput)
for idx := range output {
if output[idx] != testCase.expectedOutput[idx] {
success = false
break
}
}
}
if !success {
t.Error("For", testCase.input, "expected", testCase.expectedOutput, "got", output)
}

View File

@@ -10,11 +10,8 @@ func BoolToFloat(b bool) float64 {
if b {
return 1.0
}
return 0.0
}
func IsEmpty(v *string) bool {
return v == nil || *v == ""
return 0.0
}
func ToPTR[t any](v t) *t {