MCPcopy Create free account
hub / github.com/barnybug/cli53 / GetOptString

Method GetOptString

util.go:411–420  ·  view source on GitHub ↗
(key string)

Source from the content-addressed store, hash-verified

409type KeyValues []interface{}
410
411func (kvs KeyValues) GetOptString(key string) *string {
412 for i := 0; i < len(kvs); i += 2 {
413 if kvs[i] == key {
414 if value, ok := kvs[i+1].(string); ok {
415 return &value
416 }
417 }
418 }
419 return nil
420}
421
422func (kvs KeyValues) GetString(key string) string {
423 val := kvs.GetOptString(key)

Callers 3

GetStringMethod · 0.95
ParseMethod · 0.80
parseCommentFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected