diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2025-04-11 18:14:54 -0400 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2025-04-11 18:14:54 -0400 |
| commit | 1373e3fb7eb9e504689cf629c15a713c157aae8d (patch) | |
| tree | 511650e40a5d615c07c032b7b433b85c0f91c328 /hosts | |
| parent | 82adb2ee0fc8322e420a18002e214fedafd4e33a (diff) | |
| download | hose-1373e3fb7eb9e504689cf629c15a713c157aae8d.zip | |
append newline to known_hosts
Diffstat (limited to 'hosts')
| -rw-r--r-- | hosts/hosts.go | 4 |
1 files 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 |