From 241e6e0789184280faa84279de66b6f0de08f787 Mon Sep 17 00:00:00 2001 From: junczhu Date: Tue, 9 Jan 2024 07:59:47 +0000 Subject: [PATCH] chore: rename func for readability --- httpserver/handlers.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/httpserver/handlers.go b/httpserver/handlers.go index 026dfa1d0..92796ef2c 100644 --- a/httpserver/handlers.go +++ b/httpserver/handlers.go @@ -83,7 +83,7 @@ func (server *Server) verify(ctx context.Context, w http.ResponseWriter, r *http results = append(results, returnItem) mu.Unlock() }() - if err := server.componentsValidation(verifyComponents); err != nil { + if err := server.validateComponents(verifyComponents); err != nil { logger.GetLogger(ctx, server.LogOption).Error(err) returnItem.Error = err.Error() return @@ -192,7 +192,7 @@ func (server *Server) mutate(ctx context.Context, w http.ResponseWriter, r *http results = append(results, returnItem) mu.Unlock() }() - if err := server.componentsValidation(mutateComponents); err != nil { + if err := server.validateComponents(mutateComponents); err != nil { logger.GetLogger(ctx, server.LogOption).Error(err) returnItem.Error = err.Error() return @@ -237,7 +237,7 @@ func (server *Server) mutate(ctx context.Context, w http.ResponseWriter, r *http return sendResponse(&results, "", w, http.StatusOK, true) } -func (server *Server) componentsValidation(handlerComponents string) error { +func (server *Server) validateComponents(handlerComponents string) error { if handlerComponents == mutateComponents { if len(server.GetExecutor().ReferrerStores) == 0 { return errors.ErrorCodeConfigInvalid.WithComponentType(errors.ReferrerStore).WithDetail("referrer store config should have at least one store")