From 374ba3b54493e2850526f8fc98f9c08f8c08b4b8 Mon Sep 17 00:00:00 2001 From: Leonardo Araujo Date: Sun, 20 Oct 2024 15:02:24 -0300 Subject: [PATCH] fix: error handling --- pkg/post/post.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/post/post.go b/pkg/post/post.go index f7491a6..753dc5f 100644 --- a/pkg/post/post.go +++ b/pkg/post/post.go @@ -42,30 +42,30 @@ func Post() error { rate_usd, err := coinapi.FetchRate("USD") if err != nil { - return errors.New("error fetching rate for USD") + return err } rate_eur, err := coinapi.FetchRate("EUR") if err != nil { - return errors.New("error fetching rate for EUR") + return err } rate_brl, err := coinapi.FetchRate("BRL") if err != nil { - return errors.New("error fetching rate for BRL") + return err } daily_variation_usd, err := coinapi.FetchDailyVariation("USD") if err != nil { - return errors.New("error fetching daily vartion for USD") + return err } daily_variation_eur, err := coinapi.FetchDailyVariation("EUR") if err != nil { - return errors.New("error fetching daily vartion for EUR") + return err } daily_variation_brl, err := coinapi.FetchDailyVariation("BRL") if err != nil { - return errors.New("error fetching daily vartion for BRL") + return err } content := fmt.Sprintf(`1 BTC = %.0f USD (%.2f %%)\n