unmarshal function is not needed anymore
This commit is contained in:
parent
c92407620a
commit
16b8a8f4df
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue