MCPcopy Create free account
hub / github.com/nsf/gocode / set_option

Method set_option

config.go:141–155  ·  view source on GitHub ↗
(name, value string)

Source from the content-addressed store, hash-verified

139}
140
141func (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
157func (this *config) value_and_type() (reflect.Value, reflect.Type) {
158 v := reflect.ValueOf(this).Elem()

Callers 1

server_setFunction · 0.80

Calls 5

value_and_typeMethod · 0.95
writeMethod · 0.95
set_valueFunction · 0.85
list_valueFunction · 0.85
StringMethod · 0.80

Tested by

no test coverage detected