Skip to content
This repository has been archived by the owner on Oct 29, 2021. It is now read-only.

Commit

Permalink
btget: dump note in logging output
Browse files Browse the repository at this point in the history
still need my public key first, haha.
  • Loading branch information
philips committed May 4, 2020
1 parent 269deb5 commit 8c82d7b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions btget/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,12 @@ func get(cmd *cobra.Command, args []string) {

// Step 0: Initialize cache if needed
vkey := "sum.golang.org+033de0ae+Ac4zctda0e5eza+HJyk9SxEdh+s3Ux18htTTAD8OuAn8"
if _, err := note.NewVerifier(vkey); err != nil {
verifier, err := note.NewVerifier(vkey)
if err != nil {
log.Fatalf("invalid verifier key: %v", err)
}
verifiers := note.VerifierList(verifier)

cache := NewClientCache()
_, err = cache.ReadConfig("key")
if err == nil {
Expand All @@ -205,7 +208,12 @@ func get(cmd *cobra.Command, args []string) {
if err != nil {
log.Fatal(err)
}
os.Stdout.Write(data)
n, err := note.Open(data, verifiers)
if err != nil {
fmt.Println(err)
return
}
fmt.Printf("%s (%08x):\n%s", n.Sigs[0].Name, n.Sigs[0].Hash, n.Text)

// create download request
req, err := grab.NewRequest("", durl)
Expand Down

0 comments on commit 8c82d7b

Please sign in to comment.