server_unix.go 225 B

12345678910111213141516
  1. //go:build !windows && !plan9
  2. // +build !windows,!plan9
  3. package sftp
  4. import (
  5. "path"
  6. )
  7. func (s *Server) toLocalPath(p string) string {
  8. if s.workDir != "" && !path.IsAbs(p) {
  9. p = path.Join(s.workDir, p)
  10. }
  11. return p
  12. }