Skip to content

Commit

Permalink
Added handler for fields of interface(), So we are able to update con…
Browse files Browse the repository at this point in the history
…fig field server from cmd
  • Loading branch information
hugozhu committed Jun 10, 2013
1 parent b38d7e0 commit 38a1121
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions shadowsocks/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 != "" {
Expand Down

0 comments on commit 38a1121

Please sign in to comment.