From 93fde0789bd1d7314ef88a84f6f5f165be5b75b6 Mon Sep 17 00:00:00 2001 From: Nate Sales Date: Wed, 20 Nov 2024 01:52:38 -0500 Subject: [PATCH] docs: add readme --- cmd/main.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cmd/main.go b/cmd/main.go index ee89c1b..1c087be 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -2,6 +2,7 @@ package main import ( _ "embed" + "encoding/base64" "encoding/json" "flag" "fmt" @@ -89,8 +90,12 @@ func main() { if err != nil { panic(err) } - defer resp.Body.Close() - attDocBytes, err = io.ReadAll(resp.Body) + + var attDocB64 string + if err := json.NewDecoder(resp.Body).Decode(&attDocB64); err != nil { + panic(err) + } + attDocBytes, err = base64.StdEncoding.DecodeString(attDocB64) if err != nil { panic(err) }