From 16b8a8f4dfd58d59ce872d6076caed0db03a1737 Mon Sep 17 00:00:00 2001 From: Gregory Eremin Date: Sat, 29 Aug 2015 13:56:45 +0300 Subject: [PATCH] unmarshal function is not needed anymore --- confection.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/confection.go b/confection.go index 30c3711..a88e9ad 100644 --- a/confection.go +++ b/confection.go @@ -59,7 +59,7 @@ func bootstrap() { func update(body []byte) { dupe := duplicate(config) - if err := unmarshal(body, dupe); err != nil { + if err := json.Unmarshal(body, dupe); err != nil { log.Println("Failed to update config") return } @@ -90,14 +90,6 @@ func isStructPtr(target interface{}) bool { return false } -func unmarshal(body []byte, target interface{}) error { - if err := json.Unmarshal(body, target); err != nil { - return err - } - - return nil -} - func duplicate(original interface{}) interface{} { // Get the interface value val := reflect.ValueOf(original)