From 54204bc89b65a323fbf174696240866193e199e4 Mon Sep 17 00:00:00 2001 From: chrislu Date: Thu, 21 Nov 2024 08:52:37 -0800 Subject: [PATCH] format error --- weed/filer/elastic/v7/elastic_store.go | 10 +++++----- weed/filer/elastic/v7/elastic_store_kv.go | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/weed/filer/elastic/v7/elastic_store.go b/weed/filer/elastic/v7/elastic_store.go index 1832ddb73..bf9d3394e 100644 --- a/weed/filer/elastic/v7/elastic_store.go +++ b/weed/filer/elastic/v7/elastic_store.go @@ -78,12 +78,12 @@ func (store *ElasticStore) initialize(options []elastic.ClientOptionFunc) (err e ctx := context.Background() store.client, err = elastic.NewClient(options...) if err != nil { - return fmt.Errorf("init elastic %v.", err) + return fmt.Errorf("init elastic %v", err) } if ok, err := store.client.IndexExists(indexKV).Do(ctx); err == nil && !ok { _, err = store.client.CreateIndex(indexKV).Body(kvMappings).Do(ctx) if err != nil { - return fmt.Errorf("create index(%s) %v.", indexKV, err) + return fmt.Errorf("create index(%s) %v", indexKV, err) } } return nil @@ -114,7 +114,7 @@ func (store *ElasticStore) InsertEntry(ctx context.Context, entry *filer.Entry) value, err := jsoniter.Marshal(esEntry) if err != nil { glog.Errorf("insert entry(%s) %v.", string(entry.FullPath), err) - return fmt.Errorf("insert entry %v.", err) + return fmt.Errorf("insert entry marshal %v", err) } _, err = store.client.Index(). Index(index). @@ -124,7 +124,7 @@ func (store *ElasticStore) InsertEntry(ctx context.Context, entry *filer.Entry) Do(ctx) if err != nil { glog.Errorf("insert entry(%s) %v.", string(entry.FullPath), err) - return fmt.Errorf("insert entry %v.", err) + return fmt.Errorf("insert entry %v", err) } return nil } @@ -194,7 +194,7 @@ func (store *ElasticStore) deleteEntry(ctx context.Context, index, id string) (e } } glog.Errorf("delete entry(index:%s,_id:%s) %v.", index, id, err) - return fmt.Errorf("delete entry %v.", err) + return fmt.Errorf("delete entry %v", err) } func (store *ElasticStore) DeleteFolderChildren(ctx context.Context, fullpath weed_util.FullPath) (err error) { diff --git a/weed/filer/elastic/v7/elastic_store_kv.go b/weed/filer/elastic/v7/elastic_store_kv.go index 886125431..86262bc0f 100644 --- a/weed/filer/elastic/v7/elastic_store_kv.go +++ b/weed/filer/elastic/v7/elastic_store_kv.go @@ -26,7 +26,7 @@ func (store *ElasticStore) KvDelete(ctx context.Context, key []byte) (err error) } } glog.Errorf("delete key(id:%s) %v.", string(key), err) - return fmt.Errorf("delete key %v.", err) + return fmt.Errorf("delete key %v", err) } func (store *ElasticStore) KvGet(ctx context.Context, key []byte) (value []byte, err error) { @@ -53,7 +53,7 @@ func (store *ElasticStore) KvPut(ctx context.Context, key []byte, value []byte) val, err := jsoniter.Marshal(esEntry) if err != nil { glog.Errorf("insert key(%s) %v.", string(key), err) - return fmt.Errorf("insert key %v.", err) + return fmt.Errorf("insert key %v", err) } _, err = store.client.Index(). Index(indexKV).