fix spelling mistakes

This commit is contained in:
PatHoo
2020-04-22 10:17:49 +08:00
parent 2cf2bc42dc
commit 31ec6dfa68
4 changed files with 20 additions and 13 deletions
+5 -4
View File
@@ -2,11 +2,12 @@ package cmd
import (
"fmt"
"github.com/wonderivan/logger"
"path"
"strconv"
"strings"
"time"
"github.com/wonderivan/logger"
)
const oneMBByte = 1024 * 1024
@@ -32,8 +33,8 @@ func LoggerFileSize(filename string, size int) {
}
}
//RemoteFilExist is
func IsFilExist(filepath string) bool {
//RemoteFileExist is
func IsFileExist(filepath string) bool {
// if remote file is
// ls -l | grep aa | wc -l
fileName := path.Base(filepath) // aa
@@ -44,7 +45,7 @@ func IsFilExist(filepath string) bool {
count, err := strconv.Atoi(strings.TrimSpace(data))
defer func() {
if r := recover(); r != nil {
logger.Error("[os][%s]RemoteFilExist:%s", filepath, err)
logger.Error("[os][%s]RemoteFileExist:%s", filepath, err)
}
}()
if err != nil {
+5 -4
View File
@@ -2,11 +2,12 @@ package sshutil
import (
"fmt"
"github.com/wonderivan/logger"
"path"
"strconv"
"strings"
"time"
"github.com/wonderivan/logger"
)
const oneMBByte = 1024 * 1024
@@ -32,8 +33,8 @@ func (ss *SSH) LoggerFileSize(host, filename string, size int) {
}
}
//RemoteFilExist is
func (ss *SSH) IsFilExist(host, remoteFilePath string) bool {
//RemoteFileExist is
func (ss *SSH) IsFileExist(host, remoteFilePath string) bool {
// if remote file is
// ls -l | grep aa | wc -l
remoteFileName := path.Base(remoteFilePath) // aa
@@ -46,7 +47,7 @@ func (ss *SSH) IsFilExist(host, remoteFilePath string) bool {
count, err := strconv.Atoi(strings.TrimSpace(data))
defer func() {
if r := recover(); r != nil {
logger.Error("[ssh][%s]RemoteFilExist:%s", host, err)
logger.Error("[ssh][%s]RemoteFileExist:%s", host, err)
}
}()
if err != nil {