mirror of
https://github.com/restic/restic.git
synced 2025-12-11 18:47:50 +00:00
Fix linter warnings
This commit is contained in:
@@ -64,7 +64,7 @@ func TestBucketWidth(t *testing.T) {
|
||||
|
||||
b := e.buckets.Back().Value.(*rateBucket)
|
||||
rtest.Assert(t, b.totalBytes == 2, "b.totalBytes is %d, want 2", b.totalBytes)
|
||||
rtest.Assert(t, b.end == when.Add(bucketWidth), "b.end is %v, want %v", b.end, when.Add(bucketWidth))
|
||||
rtest.Assert(t, b.end.Equal(when.Add(bucketWidth)), "b.end is %v, want %v", b.end, when.Add(bucketWidth))
|
||||
|
||||
// Recording a byte outside the bucket width causes another bucket.
|
||||
e.recordBytes(when.Add(bucketWidth), 1)
|
||||
@@ -72,7 +72,7 @@ func TestBucketWidth(t *testing.T) {
|
||||
|
||||
b = e.buckets.Back().Value.(*rateBucket)
|
||||
rtest.Assert(t, b.totalBytes == 1, "b.totalBytes is %d, want 1", b.totalBytes)
|
||||
rtest.Assert(t, b.end == when.Add(2*bucketWidth), "b.end is %v, want %v", b.end, when.Add(bucketWidth))
|
||||
rtest.Assert(t, b.end.Equal(when.Add(2*bucketWidth)), "b.end is %v, want %v", b.end, when.Add(bucketWidth))
|
||||
|
||||
// Recording a byte after a longer delay creates a sparse bucket list.
|
||||
e.recordBytes(when.Add(time.Hour+time.Millisecond), 7)
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
// GetProgressChannel returns a channel with which a single listener
|
||||
// receives each incoming signal.
|
||||
func GetProgressChannel() <-chan os.Signal {
|
||||
signals.Once.Do(func() {
|
||||
signals.once.Do(func() {
|
||||
signals.ch = make(chan os.Signal, 1)
|
||||
setupSignals()
|
||||
})
|
||||
@@ -19,6 +19,6 @@ func GetProgressChannel() <-chan os.Signal {
|
||||
// XXX The fact that signals is a single global variable means that only one
|
||||
// listener receives each incoming signal.
|
||||
var signals struct {
|
||||
ch chan os.Signal
|
||||
sync.Once
|
||||
ch chan os.Signal
|
||||
once sync.Once
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user