MCPcopy Create free account
hub / github.com/brettlangdon/forge / SetString

Method SetString

section.go:278–287  ·  view source on GitHub ↗

SetString will set the value for name as a string

(name string, value string)

Source from the content-addressed store, hash-verified

276
277// SetString will set the value for name as a string
278func (section *Section) SetString(name string, value string) {
279 current, err := section.Get(name)
280
281 // Exists just update the value/type
282 if err == nil {
283 current.UpdateValue(value)
284 } else {
285 section.Set(name, NewString(value))
286 }
287}
288
289// Resolve will recursively try to fetch the provided value and will respond
290// with an error if the name does not exist or tries to be resolved through

Callers 1

TestSectionKeysFunction · 0.95

Calls 4

GetMethod · 0.95
SetMethod · 0.95
NewStringFunction · 0.85
UpdateValueMethod · 0.65

Tested by 1

TestSectionKeysFunction · 0.76