reformat with gofmt
This commit is contained in:
parent
d82c17e0a1
commit
7816566d59
9 changed files with 221 additions and 216 deletions
|
|
@ -3,19 +3,19 @@ package main
|
|||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"strconv"
|
||||
log "github.com/sirupsen/logrus"
|
||||
qrcode "github.com/skip2/go-qrcode"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
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 main() {
|
||||
|
|
@ -29,27 +29,26 @@ func main() {
|
|||
return
|
||||
}
|
||||
|
||||
// check if card_name exists
|
||||
|
||||
// check if card_name exists
|
||||
card_count, err := db_get_card_name_count(*card_name_ptr)
|
||||
if err != nil {
|
||||
log.Warn(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
card_count, err := db_get_card_name_count(*card_name_ptr)
|
||||
if err != nil {
|
||||
log.Warn(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
if card_count == 0 {
|
||||
fmt.Println("the card name does not exist in the database")
|
||||
return
|
||||
}
|
||||
if card_count == 0 {
|
||||
fmt.Println("the card name does not exist in the database")
|
||||
return
|
||||
}
|
||||
|
||||
// set the card as wiped and disabled, get the keys
|
||||
|
||||
card_wipe_info_values, err := db_wipe_card(*card_name_ptr)
|
||||
if err != nil {
|
||||
log.Warn(err.Error())
|
||||
return
|
||||
}
|
||||
card_wipe_info_values, err := db_wipe_card(*card_name_ptr)
|
||||
if err != nil {
|
||||
log.Warn(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// show a QR code on the console
|
||||
|
||||
|
|
@ -63,7 +62,7 @@ func main() {
|
|||
`"k4": "` + card_wipe_info_values.k4 + `",` +
|
||||
`"uid": "` + card_wipe_info_values.uid + `",` +
|
||||
`"version": 1` +
|
||||
`}`;
|
||||
`}`
|
||||
|
||||
fmt.Println()
|
||||
q, err := qrcode.New(qr, qrcode.Medium)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue