Documentation
¶
Overview ¶
Package knownhosts gives a run's commands a known_hosts file Go's SSH clients can read. golang.org/x/crypto/ssh/knownhosts, which go-git's SSH transport uses, refuses a whole file for one line whose key type it does not know (a post-quantum host key OpenSSH accepts, for one), so every go-git SSH test of a machine whose known_hosts holds such a line fails. Parseable writes the machine's known_hosts without those lines to a file of its own, for the command's SSH_KNOWN_HOSTS; the machine's files stay untouched.
Index ¶
Constants ¶
const Env = "SSH_KNOWN_HOSTS"
Env is the variable go-git reads its known_hosts files from, a list separated like PATH; set, it replaces the default files.
Variables ¶
This section is empty.
Functions ¶
func Defaults ¶
Defaults are the files go-git reads when Env is unset, home first: ~/.ssh/known_hosts and /etc/ssh/ssh_known_hosts.
func Parseable ¶
Parseable writes the lines of srcs that Go's knownhosts parses to dst and reports how many lines it dropped. With nothing dropped it writes no file and returns 0: the sources serve as they are. A missing source counts as empty. dst is replaced atomically, so concurrent runs read a whole file.
Types ¶
This section is empty.