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

Function buildHostBlock

cmd/fssh/config_gen.go:50–57  ·  view source on GitHub ↗
(host, user, port, sock string)

Source from the content-addressed store, hash-verified

48}
49
50func buildHostBlock(host, user, port, sock string) string {
51 var b strings.Builder
52 b.WriteString("Host "); b.WriteString(host); b.WriteString("\n")
53 if user != "" { b.WriteString(" User "); b.WriteString(user); b.WriteString("\n") }
54 if port != "" { b.WriteString(" Port "); b.WriteString(port); b.WriteString("\n") }
55 b.WriteString(" IdentityAgent "); b.WriteString(sock); b.WriteString("\n")
56 return b.String()
57}
58
59func readFileOrEmpty(p string) string {
60 b, err := os.ReadFile(p)

Callers 1

cmdConfigGenFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected