satisfy full linter (#77)

This commit is contained in:
T. von Dein
2026-07-07 23:46:43 +02:00
parent b8e0ee074c
commit 0d63e7c4d2
47 changed files with 1206 additions and 1171 deletions

View File

@@ -36,7 +36,6 @@ import (
func IndexTemplateList(conf *cfg.Config) error {
res, err := conf.DefaultCluster.ES().Indices.GetIndexTemplate().
Do(context.Background())
if err != nil {
return fmt.Errorf("failed to get index templates: %w", esErrorString(err))
}
@@ -56,6 +55,7 @@ func IndexTemplateList(conf *cfg.Config) error {
}
table.Sort()
return table.Print()
}
@@ -63,7 +63,6 @@ func IndexTemplateShow(conf *cfg.Config, tplname string) error {
res, err := conf.DefaultCluster.ES().Indices.GetIndexTemplate().
Name(tplname).
Do(context.Background())
if err != nil {
return fmt.Errorf("failed to get index template: %w", esErrorString(err))
}
@@ -109,10 +108,11 @@ func IndexTemplateShow(conf *cfg.Config, tplname string) error {
err = getIndexTemplateSettings(conf, tplname, table)
if err != nil {
return nil
return err
}
fmt.Println()
if err := table.Print(); err != nil {
return err
}
@@ -137,6 +137,7 @@ func IndexTemplateShow(conf *cfg.Config, tplname string) error {
}
fmt.Println()
if err := table.Print(); err != nil {
return err
}
@@ -224,7 +225,6 @@ func IndexTemplateCreate(conf *cfg.Config, name string, mappings []string) error
create.IndexPatterns(conf.Patterns...)
_, err := create.Do(context.Background())
if err != nil {
return fmt.Errorf("failed to create index template: %w", esErrorString(err))
}
@@ -241,7 +241,6 @@ func IndexTemplateModify(conf *cfg.Config, name string, mappings []string) error
res, err := conf.DefaultCluster.ES().Indices.GetIndexTemplate().
Name(name).
Do(context.Background())
if err != nil {
return fmt.Errorf("failed to get index template: %w", esErrorString(err))
}
@@ -335,7 +334,6 @@ func IndexTemplateModify(conf *cfg.Config, name string, mappings []string) error
modify.IndexPatterns(patterns...)
_, err = modify.Do(context.Background())
if err != nil {
return fmt.Errorf("failed to modify index template: %w", esErrorString(err))
}
@@ -366,7 +364,6 @@ func rolloverAliasIndexTemplate(conf *cfg.Config, name string) error {
res, err := conf.DefaultCluster.ES().Indices.GetIndexTemplate().
Name(name).
Do(context.Background())
if err != nil {
return fmt.Errorf("failed to get index template: %w", esErrorString(err))
}
@@ -417,7 +414,6 @@ func rolloverAliasIndexTemplate(conf *cfg.Config, name string) error {
}
return nil
}
func modMappings(mappings []string) (types.TypeMappingVariant, error) {