New lint version upgrade (#4056)

* New lint version upgrade

- linter was upgraded

Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>

* enable-a;; is deprecated

* minor change

* another try

* some more changes

* some more changes

* reenable prealloc

* add version till bot is fixed
This commit is contained in:
Marko
2019-10-14 17:40:15 +02:00
committed by GitHub
parent aaa060fda4
commit 7edc0601d5
17 changed files with 84 additions and 56 deletions

View File

@@ -107,7 +107,7 @@ const timeRemLimit = 999*time.Hour + 59*time.Minute + 59*time.Second
// Status represents the current Monitor status. All transfer rates are in bytes
// per second rounded to the nearest byte.
type Status struct {
Active bool // Flag indicating an active transfer
Start time.Time // Transfer start time
Bytes int64 // Total number of bytes transferred
Samples int64 // Total number of samples taken
InstRate int64 // Instantaneous transfer rate
@@ -115,11 +115,11 @@ type Status struct {
AvgRate int64 // Average transfer rate (Bytes / Duration)
PeakRate int64 // Maximum instantaneous transfer rate
BytesRem int64 // Number of bytes remaining in the transfer
Start time.Time // Transfer start time
Duration time.Duration // Time period covered by the statistics
Idle time.Duration // Time since the last transfer of at least 1 byte
TimeRem time.Duration // Estimated time to completion
Progress Percent // Overall transfer progress
Active bool // Flag indicating an active transfer
}
// Status returns current transfer status information. The returned value

View File

@@ -81,12 +81,12 @@ func TestReader(t *testing.T) {
// Active, Bytes, Samples, InstRate, CurRate, AvgRate, PeakRate, BytesRem, Start, Duration, Idle, TimeRem, Progress
want := []Status{
{true, 0, 0, 0, 0, 0, 0, 0, start, 0, 0, 0, 0},
{true, 10, 1, 100, 100, 100, 100, 0, start, _100ms, 0, 0, 0},
{true, 20, 2, 100, 100, 100, 100, 0, start, _200ms, _100ms, 0, 0},
{true, 20, 3, 0, 90, 67, 100, 0, start, _300ms, _200ms, 0, 0},
{false, 20, 3, 0, 0, 67, 100, 0, start, _300ms, 0, 0, 0},
{false, 20, 3, 0, 0, 67, 100, 0, start, _300ms, 0, 0, 0},
{start, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true},
{start, 10, 1, 100, 100, 100, 100, 0, _100ms, 0, 0, 0, true},
{start, 20, 2, 100, 100, 100, 100, 0, _200ms, _100ms, 0, 0, true},
{start, 20, 3, 0, 90, 67, 100, 0, _300ms, _200ms, 0, 0, true},
{start, 20, 3, 0, 0, 67, 100, 0, _300ms, 0, 0, 0, false},
{start, 20, 3, 0, 0, 67, 100, 0, _300ms, 0, 0, 0, false},
}
for i, s := range status {
s := s
@@ -140,9 +140,10 @@ func TestWriter(t *testing.T) {
// Active, Bytes, Samples, InstRate, CurRate, AvgRate, PeakRate, BytesRem, Start, Duration, Idle, TimeRem, Progress
want := []Status{
{true, 80, 4, 200, 200, 200, 200, 20, start, _400ms, 0, _100ms, 80000},
{true, 100, 5, 200, 200, 200, 200, 0, start, _500ms, _100ms, 0, 100000},
{start, 80, 4, 200, 200, 200, 200, 20, _400ms, 0, _100ms, 80000, true},
{start, 100, 5, 200, 200, 200, 200, 0, _500ms, _100ms, 0, 100000, true},
}
for i, s := range status {
s := s
if !statusesAreEqual(&s, &want[i]) {