(name, value string)
| 139 | } |
| 140 | |
| 141 | func (this *config) set_option(name, value string) string { |
| 142 | str, typ := this.value_and_type() |
| 143 | buf := bytes.NewBuffer(make([]byte, 0, 256)) |
| 144 | for i := 0; i < str.NumField(); i++ { |
| 145 | v := str.Field(i) |
| 146 | nm := typ.Field(i).Tag.Get("json") |
| 147 | if nm == name { |
| 148 | set_value(v, value) |
| 149 | list_value(v, name, buf) |
| 150 | } |
| 151 | } |
| 152 | this.write() |
| 153 | return buf.String() |
| 154 | |
| 155 | } |
| 156 | |
| 157 | func (this *config) value_and_type() (reflect.Value, reflect.Type) { |
| 158 | v := reflect.ValueOf(this).Elem() |
no test coverage detected