style: 函数注释

This commit is contained in:
TsMask
2024-10-09 17:40:00 +08:00
parent d1020bd255
commit d157ed8e3c

View File

@@ -60,7 +60,7 @@ func (s *SSHClientSFTP) CopyDirRemoteToLocal(remoteDir, localDir string) error {
return nil
}
// CopyDirRemoteToLocal 复制目录-本地到远程
// CopyDirLocalToRemote 复制目录-本地到远程
func (s *SSHClientSFTP) CopyDirLocalToRemote(localDir, remoteDir string) error {
// 遍历本地目录中的文件和子目录并复制到远程
err := filepath.Walk(localDir, func(localPath string, info os.FileInfo, err error) error {
@@ -94,7 +94,7 @@ func (s *SSHClientSFTP) CopyDirLocalToRemote(localDir, remoteDir string) error {
return nil
}
// CopyDirRemoteToLocal 复制文件-远程到本地
// CopyFileRemoteToLocal 复制文件-远程到本地
func (s *SSHClientSFTP) CopyFileRemoteToLocal(remotePath, localPath string) error {
if err := os.MkdirAll(filepath.Dir(localPath), 0775); err != nil {
return err
@@ -124,7 +124,7 @@ func (s *SSHClientSFTP) CopyFileRemoteToLocal(remotePath, localPath string) erro
return nil
}
// CopyDirRemoteToLocal 复制文件-本地到远程
// CopyFileLocalToRemote 复制文件-本地到远程
func (s *SSHClientSFTP) CopyFileLocalToRemote(localPath, remotePath string) error {
// 打开本地文件
localFile, err := os.Open(localPath)