diff --git a/src/cli/cli.go b/src/cli/cli.go index 3ccfde3c..f69d4015 100644 --- a/src/cli/cli.go +++ b/src/cli/cli.go @@ -103,7 +103,7 @@ func getConfigDir() (homedir string, err error) { return } 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) err = os.MkdirAll(homedir, 0700) } diff --git a/src/croc/croc.go b/src/croc/croc.go index 4fdc1aa5..9ad1ab3c 100644 --- a/src/croc/croc.go +++ b/src/croc/croc.go @@ -124,12 +124,12 @@ type RemoteFileRequest struct { FilesToTransferCurrentNum int } -// SenderInfo lists the files to be transfered +// SenderInfo lists the files to be transferred type SenderInfo struct { 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) { c = new(Client) c.FilesHasFinished = make(map[int]struct{}) @@ -461,7 +461,7 @@ func (c *Client) transfer(options TransferOptions) (err error) { break } } - // purge errors that come from succesful transfer + // purge errors that come from successful transfer if c.SuccessfulTransfer { if err != nil { log.Debugf("purging error: %s", err) @@ -765,7 +765,7 @@ func (c *Client) updateState() (err error) { c.CurrentFile, errOpen = os.OpenFile( pathToFile, os.O_WRONLY, 0666) - truncate := false + var truncate bool // default false c.CurrentFileChunks = []int64{} c.CurrentFileChunkRanges = []int64{} if errOpen == nil { @@ -826,7 +826,7 @@ func (c *Client) updateState() (err error) { if !c.firstSend { fmt.Fprintf(os.Stderr, "\nSending (->%s)\n", c.ExternalIPConnected) 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 { if c.FilesToTransfer[i].Size == 0 { // setup the progressbar and takedown the progress bar for empty files