From 07e19342ce84524b2d8888a350088d051341ed74 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Fri, 31 Mar 2023 17:40:17 -0300 Subject: [PATCH] fix: do not hard-error if included file does not exist (#170) Signed-off-by: Carlos A Becker --- sshconfig/parse.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sshconfig/parse.go b/sshconfig/parse.go index fc4ff21..c25f72f 100644 --- a/sshconfig/parse.go +++ b/sshconfig/parse.go @@ -3,6 +3,7 @@ package sshconfig import ( "bytes" + "errors" "fmt" "io" "net" @@ -222,6 +223,9 @@ func parseInternal(r io.Reader) (*hostinfoMap, error) { } included, err := parseFileInternal(path) if err != nil { + if errors.Is(err, os.ErrNotExist) { + continue + } return nil, err } infos.set(name, info)