fix(all): introduce and use iox.CopyContext (#380)
* fix(all): introduce and use iox.CopyContext This PR is part of https://github.com/ooni/probe/issues/1417. In https://github.com/ooni/probe-cli/pull/379 we introduced a context aware wrapper for io.ReadAll (formerly ioutil.ReadAll). Here we introduce a context aware wrapper for io.Copy. * fix(humanize): more significant digits * fix: rename humanize files to follow the common pattern * fix aligment * fix test
This commit is contained in:
@@ -82,7 +82,7 @@ func (mgr downloadManager) doRun(ctx context.Context) error {
|
||||
}
|
||||
continue
|
||||
}
|
||||
n, err := io.Copy(io.Discard, reader)
|
||||
n, err := iox.CopyContext(ctx, io.Discard, reader)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ import (
|
||||
|
||||
const (
|
||||
testName = "ndt"
|
||||
testVersion = "0.8.0"
|
||||
testVersion = "0.9.0"
|
||||
)
|
||||
|
||||
// Config contains the experiment settings
|
||||
|
||||
@@ -17,7 +17,7 @@ func TestNewExperimentMeasurer(t *testing.T) {
|
||||
if measurer.ExperimentName() != "ndt" {
|
||||
t.Fatal("unexpected name")
|
||||
}
|
||||
if measurer.ExperimentVersion() != "0.8.0" {
|
||||
if measurer.ExperimentVersion() != "0.9.0" {
|
||||
t.Fatal("unexpected version")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user