removed duplicated code on transfer speed message

This commit is contained in:
Mr. Joja 2017-10-25 01:01:01 -06:00
parent 414507ab1c
commit 36b546406d
1 changed files with 2 additions and 4 deletions

View File

@ -408,8 +408,6 @@ func (c *Connection) runClient() error {
return nil
}
fmt.Println("\nFile sent.")
timeSinceStart:= time.Since(startTime) / time.Second
fmt.Printf("\nTransfered with an average speed of %s/s", humanize.Bytes(uint64(float64(c.File.Size)/float64(timeSinceStart))))
} else { // Is a Receiver
if responses.notPresent {
fmt.Println("Sender is not ready. Use -wait to wait until sender connects.")
@ -468,9 +466,9 @@ func (c *Connection) runClient() error {
} else {
fmt.Printf("\nReceived file written to %s\n", path.Join(c.Path, c.File.Name))
}
timeSinceStart:= time.Since(startTime) / time.Second
fmt.Printf("\nTransfered with an average speed of %s/s", humanize.Bytes(uint64(float64(c.File.Size)/float64(timeSinceStart))))
}
timeSinceStart:= time.Since(startTime) / time.Second
fmt.Printf("\nTransfered at an average speed of %s/s", humanize.Bytes(uint64(float64(c.File.Size)/float64(timeSinceStart))))
return nil
}