From 1373e3fb7eb9e504689cf629c15a713c157aae8d Mon Sep 17 00:00:00 2001 From: Sam Anthony Date: Fri, 11 Apr 2025 18:14:54 -0400 Subject: append newline to known_hosts --- hosts/hosts.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hosts/hosts.go b/hosts/hosts.go index 63433cb..23883e2 100644 --- a/hosts/hosts.go +++ b/hosts/hosts.go @@ -54,7 +54,7 @@ func Load() (map[netip.Addr][32]byte, error) { for line := 1; scanner.Scan(); line++ { host, pubkey, err := parseHostKeyPair(scanner.Text()) if err != nil { - return hosts, fmt.Errorf("error parsing known hosts file: %s:%d: %v", err) + return hosts, fmt.Errorf("error parsing known hosts file: %s:%d: %v", knownHostsFile, line, err) } if _, ok := hosts[host]; ok { return hosts, fmt.Errorf("duplicate entry in known hosts file: %s", host) @@ -97,7 +97,7 @@ func Store(hosts map[netip.Addr][32]byte) error { defer f.Close() for host, key := range hosts { - fmt.Fprintf(f, "%s %x", host, key) + fmt.Fprintf(f, "%s %x\n", host, key) } return nil -- cgit v1.2.3