From 66aa82f8a856119eb11cf748ba13e4c09cefd339 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Wed, 31 Aug 2022 12:01:09 +0200 Subject: [PATCH] cleanup bool usage --- createboltcard/database.go | 2 +- createboltcard/main.go | 2 +- lnurlw_callback.go | 2 +- lnurlw_request.go | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/createboltcard/database.go b/createboltcard/database.go index 0928a40..77b81c3 100644 --- a/createboltcard/database.go +++ b/createboltcard/database.go @@ -52,7 +52,7 @@ func db_insert_card(one_time_code string, k0_auth_key string, k2_cmac_key string enable_flag_yn := "N" - if enable_flag == true { + if enable_flag { enable_flag_yn = "Y" } diff --git a/createboltcard/main.go b/createboltcard/main.go index a5e9a97..8d7b2eb 100644 --- a/createboltcard/main.go +++ b/createboltcard/main.go @@ -34,7 +34,7 @@ func main() { // handle -help - if *help_flag_ptr == true { + if *help_flag_ptr { flag.PrintDefaults() return } diff --git a/lnurlw_callback.go b/lnurlw_callback.go index 5e56415..b75e662 100644 --- a/lnurlw_callback.go +++ b/lnurlw_callback.go @@ -45,7 +45,7 @@ func lnurlw_callback(w http.ResponseWriter, req *http.Request) { write_error(w) return } - if lnurlw_timeout == true { + if lnurlw_timeout { log.WithFields(log.Fields{"card_payment_id": p.card_payment_id}).Info("lnurlw request has timed out") write_error(w) return diff --git a/lnurlw_request.go b/lnurlw_request.go index 4dbf491..ea1b21f 100644 --- a/lnurlw_request.go +++ b/lnurlw_request.go @@ -97,7 +97,7 @@ func setup_card_record(uid string, ctr uint32, uid_bin []byte, ctr_bin []byte, c return err } - if cmac_valid == true { + if cmac_valid { log.WithFields(log.Fields{ "i": i, "card.card_id": card.card_id, @@ -223,7 +223,7 @@ func parse_request(req *http.Request) (int, error) { return 0, err } - if cmac_valid == false { + if !cmac_valid { return 0, errors.New("cmac incorrect") } @@ -235,7 +235,7 @@ func parse_request(req *http.Request) (int, error) { return 0, err } - if counter_ok == false { + if !counter_ok { return 0, errors.New("counter not increasing") }