mirror of
https://github.com/rclone/rclone.git
synced 2025-06-03 18:53:16 +08:00
Replace deprecated ioutil
As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code.
This commit is contained in:

committed by
Nick Craig-Wood

parent
776e5ea83a
commit
5d6b8141ec
@ -3,7 +3,7 @@ package serve
|
||||
import (
|
||||
"errors"
|
||||
"html/template"
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"net/url"
|
||||
@ -94,7 +94,7 @@ func TestError(t *testing.T) {
|
||||
Error("potato", w, "sausage", err)
|
||||
resp := w.Result()
|
||||
assert.Equal(t, http.StatusInternalServerError, resp.StatusCode)
|
||||
body, _ := ioutil.ReadAll(resp.Body)
|
||||
body, _ := io.ReadAll(resp.Body)
|
||||
assert.Equal(t, "sausage.\n", string(body))
|
||||
}
|
||||
|
||||
@ -108,7 +108,7 @@ func TestServe(t *testing.T) {
|
||||
d.Serve(w, r)
|
||||
resp := w.Result()
|
||||
assert.Equal(t, http.StatusOK, resp.StatusCode)
|
||||
body, _ := ioutil.ReadAll(resp.Body)
|
||||
body, _ := io.ReadAll(resp.Body)
|
||||
assert.Equal(t, `<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
Reference in New Issue
Block a user