MCPcopy Create free account
hub / github.com/Mister-leo/fssh / parseKV

Function parseKV

internal/sshconfig/sshconfig.go:91–104  ·  view source on GitHub ↗
(line string)

Source from the content-addressed store, hash-verified

89}
90
91func parseKV(line string) (string, string) {
92 // support "Key Value" and "Key=Value", case-insensitive key
93 if eq := strings.Index(line, "="); eq >= 0 {
94 k := strings.ToLower(strings.TrimSpace(line[:eq]))
95 v := strings.TrimSpace(line[eq+1:])
96 return k, v
97 }
98 parts := strings.Fields(line)
99 if len(parts) == 0 { return "", "" }
100 k := strings.ToLower(parts[0])
101 v := strings.TrimSpace(strings.TrimPrefix(line, parts[0]))
102 v = strings.TrimSpace(v)
103 return k, v
104}

Callers 2

LoadHostInfosFunction · 0.85
parseHostBlockFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected