From d5192378d388d41c65898fc66ac5739fffc674f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Tikvi=C4=87?= Date: Mon, 28 Nov 2016 12:08:00 +0100 Subject: [PATCH] added json decoding shorthand --- json_utility.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/json_utility.go b/json_utility.go index 3edf694..00a446d 100644 --- a/json_utility.go +++ b/json_utility.go @@ -175,3 +175,6 @@ func fetchJSON(db *ora.Ses, project string) ([]byte, error) { return bytes, nil } +func DecodeJSON(r io.Reader, v interface{}) error { + return json.NewDecoder(r).Decode(v) +} -- 1.8.1.2