aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdnan Maolood <[email protected]>2020-11-09 13:57:30 -0500
committerAdnan Maolood <[email protected]>2020-11-09 13:57:30 -0500
commitf6b0443a6262d17f90b4e75cf5ae37577db7f897 (patch)
treee5efe3ca7767d0e0a718f1b3bbacec39e71dac12
parentAdd (*CertificateStore).Write function (diff)
downloadgo-gemini-f6b0443a6262d17f90b4e75cf5ae37577db7f897.tar.xz
go-gemini-f6b0443a6262d17f90b4e75cf5ae37577db7f897.zip
Update KnownHosts documentationv0.1.8
-rw-r--r--tofu.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/tofu.go b/tofu.go
index 7a89d51..b6e3be2 100644
--- a/tofu.go
+++ b/tofu.go
@@ -32,7 +32,7 @@ func (k *KnownHosts) SetOutput(w io.Writer) {
k.out = w
}
-// Add adds a fingerprint to the list of known hosts.
+// Add adds a known host to the list of known hosts.
func (k *KnownHosts) Add(hostname string, fingerprint Fingerprint) {
if k.hosts == nil {
k.hosts = map[string]Fingerprint{}
@@ -70,6 +70,7 @@ func (k *KnownHosts) writeKnownHost(w io.Writer, hostname string, f Fingerprint)
}
// Load loads the known hosts from the provided path.
+// It creates the file if it does not exist.
// New known hosts will be appended to the file.
func (k *KnownHosts) Load(path string) error {
f, err := os.OpenFile(path, os.O_CREATE|os.O_RDONLY, 0644)