Update to go1.16

This commit is contained in:
Romain 2021-03-04 20:08:03 +01:00 committed by GitHub
parent 2e7833df49
commit bdba7d3adf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
62 changed files with 217 additions and 318 deletions

View file

@ -7,7 +7,6 @@ import (
"flag"
"fmt"
"io"
"io/ioutil"
"net/http"
"os"
"path/filepath"
@ -153,14 +152,14 @@ func testConfiguration(c *check.C, path, apiPort string) {
newJSON, err := json.MarshalIndent(rtRepr, "", "\t")
c.Assert(err, checker.IsNil)
err = ioutil.WriteFile(expectedJSON, newJSON, 0o644)
err = os.WriteFile(expectedJSON, newJSON, 0o644)
c.Assert(err, checker.IsNil)
c.Errorf("We do not want a passing test in file update mode")
}
func matchesConfig(wantConfig string, buf *bytes.Buffer) try.ResponseCondition {
return func(res *http.Response) error {
body, err := ioutil.ReadAll(res.Body)
body, err := io.ReadAll(res.Body)
if err != nil {
return fmt.Errorf("failed to read response body: %w", err)
}
@ -187,7 +186,7 @@ func matchesConfig(wantConfig string, buf *bytes.Buffer) try.ResponseCondition {
return err
}
expected, err := ioutil.ReadFile(wantConfig)
expected, err := os.ReadFile(wantConfig)
if err != nil {
return err
}