aboutsummaryrefslogtreecommitdiffstats
path: root/gosrc/requests.go
diff options
context:
space:
mode:
Diffstat (limited to 'gosrc/requests.go')
-rw-r--r--gosrc/requests.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/gosrc/requests.go b/gosrc/requests.go
index 9110c89..593076b 100644
--- a/gosrc/requests.go
+++ b/gosrc/requests.go
@@ -12,6 +12,7 @@ import (
"log"
"net/http"
"strings"
+ "strconv"
)
// #include "../csrc/smith.h"
@@ -61,6 +62,7 @@ func getRequestType(name string) string {
}
}
+// display something cool
func displayResponse(node_name string, response *http.Response, output *string) {
requestType := getRequestType(node_name)
body, _ := io.ReadAll(response.Body)
@@ -80,6 +82,10 @@ func displayResponse(node_name string, response *http.Response, output *string)
"Address [" + structuredRep.Address + "]\n" +
"Url [" + structuredRep.Url + "]\n" +
"Tag [" + structuredRep.Tag + "]\n"
+ case GET_Targets.snapshot:
+ var structuredRep AccountSnapshotResponseMain
+ json.Unmarshal(body, &structuredRep)
+ outputFormatted = "code [" + strconv.FormatFloat(structuredRep.Code, 'f', 2, 64) + "]\n"
default:
outputFormatted = string(body)
}