rename var

This commit is contained in:
2026-07-08 15:00:21 +02:00
parent 51480e6b35
commit 2969522913

View File

@@ -336,12 +336,12 @@ func IndexDiskusage(conf *cfg.Config, index string) error {
return fmt.Errorf("failed to retrieve index disk usage: %w", esErrorString(err))
}
dures := ResIndexDiskUsage{}
if err := json.Unmarshal(res, &dures); err != nil {
duRes := ResIndexDiskUsage{}
if err := json.Unmarshal(res, &duRes); err != nil {
return fmt.Errorf("failed to unmarshal disk usage response: %w", err)
}
du, exists := dures[index]
diskusage, exists := duRes[index]
if !exists {
return errors.New("no disk usage reported for index")
}
@@ -349,7 +349,7 @@ func IndexDiskusage(conf *cfg.Config, index string) error {
table := printer.NewTableEmpty(conf).
WithHeaders("field", "bloom filter", "norms", "points", "term vectors", "knn vectors", "total")
for name, field := range du.Fields {
for name, field := range diskusage.Fields {
if strings.HasPrefix(name, "_") || strings.HasSuffix(name, ".keyword") {
continue
}
@@ -365,7 +365,7 @@ func IndexDiskusage(conf *cfg.Config, index string) error {
)
}
all := du.AllFields
all := diskusage.AllFields
table.Sort()