1
0
Fork 0

unmarshal function is not needed anymore

This commit is contained in:
Gregory Eremin 2015-08-29 13:56:45 +03:00
parent c92407620a
commit 16b8a8f4df
1 changed files with 1 additions and 9 deletions

View File

@ -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)