MCPcopy Create free account
hub / github.com/OpenAtomFoundation/SmartIDE / Get

Method Get

cli/pkg/ssh_config/config.go:731–746  ·  view source on GitHub ↗

Get finds the first value in the Include statement matching the alias and the given key.

(alias, key string)

Source from the content-addressed store, hash-verified

729// Get finds the first value in the Include statement matching the alias and the
730// given key.
731func (inc *Include) Get(alias, key string) string {
732 inc.mu.Lock()
733 defer inc.mu.Unlock()
734 // TODO: we search files in any order which is not correct
735 for i := range inc.matches {
736 cfg := inc.files[inc.matches[i]]
737 if cfg == nil {
738 panic("nil cfg")
739 }
740 val, err := cfg.Get(alias, key)
741 if err == nil && val != "" {
742 return val
743 }
744 }
745 return ""
746}
747
748// GetAll finds all values in the Include statement matching the alias and the
749// given key.

Callers

nothing calls this directly

Calls 1

GetMethod · 0.45

Tested by

no test coverage detected