tofu: Automatically create file in KnownHosts.Load
This commit is contained in:
parent
be3d09d7f4
commit
5677440876
@ -83,7 +83,7 @@ func (k *KnownHosts) WriteTo(w io.Writer) (int64, error) {
|
|||||||
|
|
||||||
// Load loads the known hosts entries from the provided path.
|
// Load loads the known hosts entries from the provided path.
|
||||||
func (k *KnownHosts) Load(path string) error {
|
func (k *KnownHosts) Load(path string) error {
|
||||||
f, err := os.Open(path)
|
f, err := os.OpenFile(path, os.O_CREATE|os.O_RDONLY, 0644)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user