internal/gofix and fix error wrapping (#76)

This commit is contained in:
T. von Dein
2026-07-07 10:41:34 +02:00
parent f10366dbde
commit b8e0ee074c
28 changed files with 109 additions and 119 deletions

View File

@@ -86,7 +86,7 @@ func ShardList(conf *cfg.Config) error {
res, err := conf.DefaultCluster.ES().Cat.Shards().
Do(context.Background())
if err != nil {
return fmt.Errorf("failed to get shards: %s", esErrorString(err))
return fmt.Errorf("failed to get shards: %w", esErrorString(err))
}
shardlist := filterShards(conf, res)
@@ -136,7 +136,7 @@ func ShardShow(conf *cfg.Config, index string) error {
res, err := conf.DefaultCluster.ES().Cat.Shards().Index(index).
Do(context.Background())
if err != nil {
return fmt.Errorf("failed to get shards: %s", esErrorString(err))
return fmt.Errorf("failed to get shards: %w", esErrorString(err))
}
slog.Debug("ES result", "shards", res)
@@ -158,7 +158,7 @@ func ShardAllocation(conf *cfg.Config, index string) error {
res, err := explain.Do(context.Background())
if err != nil {
return fmt.Errorf("failed to get shard allocation explain: %s", esErrorString(err))
return fmt.Errorf("failed to get shard allocation explain: %w", esErrorString(err))
}
slog.Debug("ES result", "explain", res)