Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfeistel <6742251-feistel@users.noreply.gitlab.com>2021-08-27 08:39:31 +0300
committerfeistel <6742251-feistel@users.noreply.gitlab.com>2021-09-09 06:07:22 +0300
commit9bc6df51b36a1e0f763b6ebc7974bb3d98aabf3a (patch)
tree28b88e9c3b6f2a16650164c15a28bfc62360763f /internal/serving
parent9dd40765e162aba80482abdf3ca8f788bec7a8db (diff)
refactor: move away from ioutil (deprecated)
Diffstat (limited to 'internal/serving')
-rw-r--r--internal/serving/disk/local/serving_test.go4
-rw-r--r--internal/serving/disk/symlink/path_test.go3
-rw-r--r--internal/serving/disk/zip/serving_test.go4
3 files changed, 5 insertions, 6 deletions
diff --git a/internal/serving/disk/local/serving_test.go b/internal/serving/disk/local/serving_test.go
index 2602451f..8352bfc9 100644
--- a/internal/serving/disk/local/serving_test.go
+++ b/internal/serving/disk/local/serving_test.go
@@ -1,7 +1,7 @@
package local
import (
- "io/ioutil"
+ "io"
"net/http"
"net/http/httptest"
"testing"
@@ -82,7 +82,7 @@ func TestDisk_ServeFileHTTP(t *testing.T) {
defer resp.Body.Close()
require.Equal(t, test.expectedStatus, resp.StatusCode)
- body, err := ioutil.ReadAll(resp.Body)
+ body, err := io.ReadAll(resp.Body)
require.NoError(t, err)
require.Contains(t, string(body), test.expectedBody)
diff --git a/internal/serving/disk/symlink/path_test.go b/internal/serving/disk/symlink/path_test.go
index c9da51c3..400432c2 100644
--- a/internal/serving/disk/symlink/path_test.go
+++ b/internal/serving/disk/symlink/path_test.go
@@ -6,7 +6,6 @@ package symlink_test
import (
"context"
- "io/ioutil"
"os"
"path/filepath"
"runtime"
@@ -156,7 +155,7 @@ func TestIssue13582(t *testing.T) {
t.Fatal(err)
}
file := filepath.Join(linkToDir, "file")
- err = ioutil.WriteFile(file, nil, 0644)
+ err = os.WriteFile(file, nil, 0644)
if err != nil {
t.Fatal(err)
}
diff --git a/internal/serving/disk/zip/serving_test.go b/internal/serving/disk/zip/serving_test.go
index 2cbee18d..167c47c3 100644
--- a/internal/serving/disk/zip/serving_test.go
+++ b/internal/serving/disk/zip/serving_test.go
@@ -1,7 +1,7 @@
package zip
import (
- "io/ioutil"
+ "io"
"net/http"
"net/http/httptest"
"os"
@@ -127,7 +127,7 @@ func TestZip_ServeFileHTTP(t *testing.T) {
defer resp.Body.Close()
require.Equal(t, test.expectedStatus, resp.StatusCode)
- body, err := ioutil.ReadAll(resp.Body)
+ body, err := io.ReadAll(resp.Body)
require.NoError(t, err)
require.Contains(t, string(body), test.expectedBody)