From 3cce9fa63ebef53ef40e7973b6c9a7114ca39192 Mon Sep 17 00:00:00 2001 From: Callan Bryant Date: Mon, 2 Mar 2020 02:35:32 +0000 Subject: [PATCH] start unmarshalling of config file --- add.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/add.go b/add.go index 8a007b9..bb006fb 100644 --- a/add.go +++ b/add.go @@ -1,5 +1,14 @@ package dsnet -func Add(hostname string, owner string, description string, publicKey string) { +import ( + "io/ioutil" + "encoding/json" +) +func Add(hostname string, owner string, description string, publicKey string) { + raw, err := ioutil.ReadFile(CONFIG_FILE) + check(err) + conf := DsnetConfig{} + err = json.Unmarshal(raw, &conf) + check(err) }