MCPcopy Create free account
hub / github.com/gogs/gogs / cleanUpOpenSSHVersion

Function cleanUpOpenSSHVersion

internal/conf/utils.go:14–18  ·  view source on GitHub ↗

cleanUpOpenSSHVersion cleans up the raw output of "ssh -V" and returns a clean version string.

(raw string)

Source from the content-addressed store, hash-verified

12
13// cleanUpOpenSSHVersion cleans up the raw output of "ssh -V" and returns a clean version string.
14func cleanUpOpenSSHVersion(raw string) string {
15 v := strings.TrimRight(strings.Fields(raw)[0], ",1234567890")
16 v = strings.TrimSuffix(strings.TrimPrefix(v, "OpenSSH_"), "p")
17 return v
18}
19
20// openSSHVersion returns string representation of OpenSSH version via command "ssh -V".
21func openSSHVersion() (string, error) {

Callers 2

openSSHVersionFunction · 0.85

Calls

no outgoing calls

Tested by 1