From 316f6d9b718a340b21d1f05e5337e20a42ad1c7b Mon Sep 17 00:00:00 2001 From: Wesley Werneck Date: Sun, 5 Nov 2023 09:27:06 -0300 Subject: [PATCH] fix currency to uppercase --- README.md | 2 +- main.go | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6df10bd..1378c3e 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ brl-rate-get -get usd ____________________________________ |#######====================#######| -|# BRL eur #| +|# BRL EUR #| |# ==== #| |# Buy: 5.2474 #| |# 1,00 Sell: 5.2500 #| diff --git a/main.go b/main.go index 675a6f9..a26ec80 100644 --- a/main.go +++ b/main.go @@ -16,7 +16,9 @@ func handle_get(currency string) { currentTime := time.Now() - rates := brlrateget.MakeRangeRequest(yesterday, currentTime, strings.ToUpper(currency), false) + currency = strings.ToUpper(currency) + + rates := brlrateget.MakeRangeRequest(yesterday, currentTime, currency, false) brlrateget.FormatGetResult(rates, currency) }