From 38a11213399f0ef59ff754ed7c416fc21f40c8b3 Mon Sep 17 00:00:00 2001 From: hugozhu Date: Mon, 10 Jun 2013 15:19:35 +0800 Subject: [PATCH] Added handler for fields of interface(), So we are able to update config field server from cmd --- shadowsocks/config.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/shadowsocks/config.go b/shadowsocks/config.go index 273c0f42..f96ff504 100644 --- a/shadowsocks/config.go +++ b/shadowsocks/config.go @@ -108,6 +108,10 @@ func UpdateConfig(old, new *Config) { // log.Printf("%d: %s %s = %v\n", i, // typeOfT.Field(i).Name, newField.Type(), newField.Interface()) switch newField.Kind() { + case reflect.Interface: + if fmt.Sprintf("%v", newField.Interface()) != "" { + oldField.Set(newField) + } case reflect.String: s := newField.String() if s != "" {