From fca731c5d26658d6813d0d33bc5d55f93ea464b1 Mon Sep 17 00:00:00 2001 From: Rose Hogenson Date: Fri, 11 Apr 2025 21:47:56 -0700 Subject: Fix a few path.Join to filepath.Join for local paths Not that this would work on Windows anyway --- internal/wfs/sftpfs/sftpfs.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'internal/wfs') diff --git a/internal/wfs/sftpfs/sftpfs.go b/internal/wfs/sftpfs/sftpfs.go index 2ec9635..b02ed8c 100644 --- a/internal/wfs/sftpfs/sftpfs.go +++ b/internal/wfs/sftpfs/sftpfs.go @@ -8,7 +8,6 @@ import ( "io/fs" "net" "os" - "path" "path/filepath" "strings" "sync" @@ -120,7 +119,7 @@ func sshKeys() ([]ssh.Signer, error) { } func appendToKnownHosts(hostname string, key ssh.PublicKey) error { - f, err := os.OpenFile(path.Join(os.Getenv("HOME"), ".ssh/known_hosts"), os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0600) + f, err := os.OpenFile(filepath.Join(os.Getenv("HOME"), ".ssh/known_hosts"), os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0600) if err != nil { return err } @@ -133,7 +132,7 @@ func appendToKnownHosts(hostname string, key ssh.PublicKey) error { // Dial establishes a new SFTP connection to the given host. func Dial(target string) (*FS, error) { - knownHostChecker, err := knownhosts.New(path.Join(os.Getenv("HOME"), ".ssh/known_hosts")) + knownHostChecker, err := knownhosts.New(filepath.Join(os.Getenv("HOME"), ".ssh/known_hosts")) if err != nil { knownHostChecker = func(string, net.Addr, ssh.PublicKey) error { return &knownhosts.KeyError{} } } -- cgit v1.3.1