fix spelling

This commit is contained in:
Zack Scholl 2019-09-07 09:49:08 -07:00
parent 845dabbae0
commit 33aa006c26
2 changed files with 6 additions and 6 deletions

View File

@ -103,7 +103,7 @@ func getConfigDir() (homedir string, err error) {
return return
} }
homedir = path.Join(homedir, ".config", "croc") homedir = path.Join(homedir, ".config", "croc")
if _, err := os.Stat(homedir); os.IsNotExist(err) { if _, err = os.Stat(homedir); os.IsNotExist(err) {
log.Debugf("creating home directory %s", homedir) log.Debugf("creating home directory %s", homedir)
err = os.MkdirAll(homedir, 0700) err = os.MkdirAll(homedir, 0700)
} }

View File

@ -124,12 +124,12 @@ type RemoteFileRequest struct {
FilesToTransferCurrentNum int FilesToTransferCurrentNum int
} }
// SenderInfo lists the files to be transfered // SenderInfo lists the files to be transferred
type SenderInfo struct { type SenderInfo struct {
FilesToTransfer []FileInfo FilesToTransfer []FileInfo
} }
// New establishes a new connection for transfering files between two instances. // New establishes a new connection for transferring files between two instances.
func New(ops Options) (c *Client, err error) { func New(ops Options) (c *Client, err error) {
c = new(Client) c = new(Client)
c.FilesHasFinished = make(map[int]struct{}) c.FilesHasFinished = make(map[int]struct{})
@ -461,7 +461,7 @@ func (c *Client) transfer(options TransferOptions) (err error) {
break break
} }
} }
// purge errors that come from succesful transfer // purge errors that come from successful transfer
if c.SuccessfulTransfer { if c.SuccessfulTransfer {
if err != nil { if err != nil {
log.Debugf("purging error: %s", err) log.Debugf("purging error: %s", err)
@ -765,7 +765,7 @@ func (c *Client) updateState() (err error) {
c.CurrentFile, errOpen = os.OpenFile( c.CurrentFile, errOpen = os.OpenFile(
pathToFile, pathToFile,
os.O_WRONLY, 0666) os.O_WRONLY, 0666)
truncate := false var truncate bool // default false
c.CurrentFileChunks = []int64{} c.CurrentFileChunks = []int64{}
c.CurrentFileChunkRanges = []int64{} c.CurrentFileChunkRanges = []int64{}
if errOpen == nil { if errOpen == nil {
@ -826,7 +826,7 @@ func (c *Client) updateState() (err error) {
if !c.firstSend { if !c.firstSend {
fmt.Fprintf(os.Stderr, "\nSending (->%s)\n", c.ExternalIPConnected) fmt.Fprintf(os.Stderr, "\nSending (->%s)\n", c.ExternalIPConnected)
c.firstSend = true c.firstSend = true
// if there are empty files, show them as already have been transfered now // if there are empty files, show them as already have been transferred now
for i := range c.FilesToTransfer { for i := range c.FilesToTransfer {
if c.FilesToTransfer[i].Size == 0 { if c.FilesToTransfer[i].Size == 0 {
// setup the progressbar and takedown the progress bar for empty files // setup the progressbar and takedown the progress bar for empty files