From ed4e18619a5c1e79641c7740db7f74182ddd7884 Mon Sep 17 00:00:00 2001 From: Rodrigo Motta Date: Mon, 25 Dec 2023 19:45:58 -0300 Subject: [PATCH] colocando as coisas em seus devidos lugares --- cli/pkg/handler/calculation_handler.go | 9 ++++----- cli/pkg/{util => handler}/error_handler.go | 2 +- cli/pkg/handler/parameter_handler.go | 4 ++-- 3 files changed, 7 insertions(+), 8 deletions(-) rename cli/pkg/{util => handler}/error_handler.go (88%) diff --git a/cli/pkg/handler/calculation_handler.go b/cli/pkg/handler/calculation_handler.go index 80c5543..0d61707 100644 --- a/cli/pkg/handler/calculation_handler.go +++ b/cli/pkg/handler/calculation_handler.go @@ -2,30 +2,29 @@ package handler import ( "profitability/cli/pkg/calculus" - "profitability/cli/pkg/util" "profitability/cli/pkg/display" ) func HandleProp(taxa float64) { result, err := calculus.Prop(taxa) - util.ErrorHandler(err) + ErrorHandler(err) display.ShowPropResult(result) } func HandlePre(taxa float64, prazo int) { result, err := calculus.Pre(taxa, prazo) - util.ErrorHandler(err) + ErrorHandler(err) display.ShowPreResult(result) } func HandlePos(taxa float64, prazo int) { result, err := calculus.Pos(taxa, prazo) - util.ErrorHandler(err) + ErrorHandler(err) display.ShowPosResult(result) } func HandleIPCA(taxa float64, prazo int) { result, err := calculus.IPCA(taxa, prazo) - util.ErrorHandler(err) + ErrorHandler(err) display.ShowIPCAResult(result) } diff --git a/cli/pkg/util/error_handler.go b/cli/pkg/handler/error_handler.go similarity index 88% rename from cli/pkg/util/error_handler.go rename to cli/pkg/handler/error_handler.go index 5783c16..579d464 100644 --- a/cli/pkg/util/error_handler.go +++ b/cli/pkg/handler/error_handler.go @@ -1,4 +1,4 @@ -package util +package handler import ( "fmt" diff --git a/cli/pkg/handler/parameter_handler.go b/cli/pkg/handler/parameter_handler.go index fd8adfb..792bd8e 100644 --- a/cli/pkg/handler/parameter_handler.go +++ b/cli/pkg/handler/parameter_handler.go @@ -32,13 +32,13 @@ func HandleModal(modalidade string) { func HandleTaxa(taxaStr string) (float64) { taxa, err := util.IsValidTaxa(taxaStr) - util.ErrorHandler(err) + ErrorHandler(err) return taxa } func HandlePrazo(prazoStr string) (int) { prazo, err := util.IsValidPrazo(prazoStr) - util.ErrorHandler(err) + ErrorHandler(err) return prazo }