From b4494c7ed3980b106244ade15d51df150176cedf Mon Sep 17 00:00:00 2001 From: Peter Rounce Date: Sun, 19 Feb 2023 06:52:12 +0000 Subject: [PATCH] fix formatting --- createboltcard.go | 4 ++-- db/db.go | 14 +++++++------- email/email.go | 2 +- lndhub/lndhub.go | 6 +++--- lnurlp/lnurlp_callback.go | 6 +++--- lnurlp/lnurlp_request.go | 4 ++-- lnurlw/lnurlw_callback.go | 12 ++++++------ lnurlw/lnurlw_request.go | 6 +++--- main.go | 6 +++--- new_card_request.go | 4 ++-- wipeboltcard.go | 4 ++-- 11 files changed, 34 insertions(+), 34 deletions(-) diff --git a/createboltcard.go b/createboltcard.go index 42a9784..c2d291d 100644 --- a/createboltcard.go +++ b/createboltcard.go @@ -3,12 +3,12 @@ package main import ( "crypto/rand" "encoding/hex" + "github.com/boltcard/boltcard/db" + "github.com/boltcard/boltcard/resp_err" log "github.com/sirupsen/logrus" "net/http" "strconv" "strings" - "github.com/boltcard/boltcard/db" - "github.com/boltcard/boltcard/resp_err" ) func random_hex() string { diff --git a/db/db.go b/db/db.go index 5a98c21..4a868fd 100644 --- a/db/db.go +++ b/db/db.go @@ -47,13 +47,13 @@ type Transaction struct { } type Card_wipe_info struct { - Id int - K0 string - K1 string - K2 string - K3 string - K4 string - Uid string + Id int + K0 string + K1 string + K2 string + K3 string + K4 string + Uid string } func open() (*sql.DB, error) { diff --git a/email/email.go b/email/email.go index 2b123e7..8f78ddd 100644 --- a/email/email.go +++ b/email/email.go @@ -6,10 +6,10 @@ import ( "github.com/aws/aws-sdk-go/aws/credentials" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/ses" + "github.com/boltcard/boltcard/db" log "github.com/sirupsen/logrus" "strconv" "strings" - "github.com/boltcard/boltcard/db" ) func Send_balance_email(recipient_email string, card_id int) { diff --git a/lndhub/lndhub.go b/lndhub/lndhub.go index e0d6153..fa5f133 100644 --- a/lndhub/lndhub.go +++ b/lndhub/lndhub.go @@ -1,10 +1,10 @@ package lndhub import ( - log "github.com/sirupsen/logrus" + log "github.com/sirupsen/logrus" - "github.com/boltcard/boltcard/db" - "github.com/boltcard/boltcard/email" + "github.com/boltcard/boltcard/db" + "github.com/boltcard/boltcard/email" ) func Pay_invoice(card_payment_id int, invoice string) { diff --git a/lnurlp/lnurlp_callback.go b/lnurlp/lnurlp_callback.go index 84fb023..1984e8c 100644 --- a/lnurlp/lnurlp_callback.go +++ b/lnurlp/lnurlp_callback.go @@ -2,13 +2,13 @@ package lnurlp import ( "encoding/hex" + "github.com/boltcard/boltcard/db" + "github.com/boltcard/boltcard/lnd" + "github.com/boltcard/boltcard/resp_err" "github.com/gorilla/mux" log "github.com/sirupsen/logrus" "net/http" "strconv" - "github.com/boltcard/boltcard/lnd" - "github.com/boltcard/boltcard/db" - "github.com/boltcard/boltcard/resp_err" ) func Callback(w http.ResponseWriter, r *http.Request) { diff --git a/lnurlp/lnurlp_request.go b/lnurlp/lnurlp_request.go index a7adfbf..6483388 100644 --- a/lnurlp/lnurlp_request.go +++ b/lnurlp/lnurlp_request.go @@ -1,11 +1,11 @@ package lnurlp import ( + "github.com/boltcard/boltcard/db" + "github.com/boltcard/boltcard/resp_err" "github.com/gorilla/mux" log "github.com/sirupsen/logrus" "net/http" - "github.com/boltcard/boltcard/db" - "github.com/boltcard/boltcard/resp_err" ) func Response(w http.ResponseWriter, r *http.Request) { diff --git a/lnurlw/lnurlw_callback.go b/lnurlw/lnurlw_callback.go index 5d31e27..d502290 100644 --- a/lnurlw/lnurlw_callback.go +++ b/lnurlw/lnurlw_callback.go @@ -1,14 +1,14 @@ package lnurlw import ( - decodepay "github.com/fiatjaf/ln-decodepay" - log "github.com/sirupsen/logrus" - "net/http" "bytes" - "io" "github.com/boltcard/boltcard/db" "github.com/boltcard/boltcard/lnd" "github.com/boltcard/boltcard/resp_err" + decodepay "github.com/fiatjaf/ln-decodepay" + log "github.com/sirupsen/logrus" + "io" + "net/http" ) func lndhub_payment(w http.ResponseWriter, p *db.Payment) { @@ -28,7 +28,7 @@ func lndhub_payment(w http.ResponseWriter, p *db.Payment) { //the login JSON is held in the Card_name field body := []byte(c.Card_name) - r, err := http.NewRequest("POST", lndhub_url + "/auth", bytes.NewBuffer(body)) + r, err := http.NewRequest("POST", lndhub_url+"/auth", bytes.NewBuffer(body)) if err != nil { log.WithFields(log.Fields{"card_payment_id": p.Card_payment_id}).Warn(err) resp_err.Write(w) @@ -57,7 +57,7 @@ func lndhub_payment(w http.ResponseWriter, p *db.Payment) { log.Info(string(b)) -// fmt.Println(string(b)) + // fmt.Println(string(b)) //lndhub.payinvoice API call } diff --git a/lnurlw/lnurlw_request.go b/lnurlw/lnurlw_request.go index b0a70b3..c3a25e2 100644 --- a/lnurlw/lnurlw_request.go +++ b/lnurlw/lnurlw_request.go @@ -4,14 +4,14 @@ import ( "encoding/hex" "encoding/json" "errors" + "github.com/boltcard/boltcard/crypto" + "github.com/boltcard/boltcard/db" + "github.com/boltcard/boltcard/resp_err" log "github.com/sirupsen/logrus" "net/http" "os" "strconv" "strings" - "github.com/boltcard/boltcard/db" - "github.com/boltcard/boltcard/crypto" - "github.com/boltcard/boltcard/resp_err" ) type ResponseData struct { diff --git a/main.go b/main.go index c06eeba..40a0ed0 100644 --- a/main.go +++ b/main.go @@ -1,13 +1,13 @@ package main import ( + "github.com/boltcard/boltcard/db" + "github.com/boltcard/boltcard/lnurlp" + "github.com/boltcard/boltcard/lnurlw" "github.com/gorilla/mux" log "github.com/sirupsen/logrus" "net/http" "time" - "github.com/boltcard/boltcard/db" - "github.com/boltcard/boltcard/lnurlw" - "github.com/boltcard/boltcard/lnurlp" ) var router = mux.NewRouter() diff --git a/new_card_request.go b/new_card_request.go index f74f4e8..5e7e545 100644 --- a/new_card_request.go +++ b/new_card_request.go @@ -3,10 +3,10 @@ package main import ( "database/sql" "encoding/json" - log "github.com/sirupsen/logrus" - "net/http" "github.com/boltcard/boltcard/db" "github.com/boltcard/boltcard/resp_err" + log "github.com/sirupsen/logrus" + "net/http" ) /** diff --git a/wipeboltcard.go b/wipeboltcard.go index a2ff0fa..3fa52fe 100644 --- a/wipeboltcard.go +++ b/wipeboltcard.go @@ -1,11 +1,11 @@ package main import ( + "github.com/boltcard/boltcard/db" + "github.com/boltcard/boltcard/resp_err" log "github.com/sirupsen/logrus" "net/http" "strconv" - "github.com/boltcard/boltcard/db" - "github.com/boltcard/boltcard/resp_err" ) func wipeboltcard(w http.ResponseWriter, r *http.Request) {