MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / trimSSHInlineComment

Function trimSSHInlineComment

agent/app/service/ssh.go:946–959  ·  view source on GitHub ↗
(line string)

Source from the content-addressed store, hash-verified

944}
945
946func trimSSHInlineComment(line string) string {
947 inQuote := false
948 for i := 0; i < len(line); i++ {
949 switch line[i] {
950 case '"':
951 inQuote = !inQuote
952 case '#':
953 if !inQuote && (i == 0 || line[i-1] == ' ' || line[i-1] == '\t') {
954 return strings.TrimSpace(line[:i])
955 }
956 }
957 }
958 return strings.TrimSpace(line)
959}
960
961func expandSSHIncludePaths(baseFile, value string) []string {
962 var includeFiles []string

Callers 1

parseSSHConfigLineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected