Skip to content
This repository has been archived by the owner on Apr 9, 2020. It is now read-only.

Commit

Permalink
Merge pull request #14 from hugozhu/develop
Browse files Browse the repository at this point in the history
Add handler for fields of interface{}, so we are able to update config field server from cmd
  • Loading branch information
cyfdecyf committed Jun 10, 2013
2 parents b38d7e0 + 38a1121 commit 2c1c359
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 2c1c359

Please sign in to comment.