diff options
| author | Eng Zer Jun <engzerjun@gmail.com> | 2021-10-14 12:27:58 +0800 |
|---|---|---|
| committer | Eng Zer Jun <engzerjun@gmail.com> | 2021-10-14 12:27:58 +0800 |
| commit | a23bcbb7ecf93fcda35976f4f2fb42a67830e718 (patch) | |
| tree | 3227e82e51346dad8649a17e991c9cf561ef8071 /weed/images | |
| parent | 4cbd390fbe634e2370c36a61b1574e9d648c3cee (diff) | |
| download | seaweedfs-a23bcbb7ecf93fcda35976f4f2fb42a67830e718.tar.xz seaweedfs-a23bcbb7ecf93fcda35976f4f2fb42a67830e718.zip | |
refactor: move from io/ioutil to io and os package
The io/ioutil package has been deprecated as of Go 1.16, see
https://golang.org/doc/go1.16#ioutil. This commit replaces the existing
io/ioutil functions with their new definitions in io and os packages.
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
Diffstat (limited to 'weed/images')
| -rw-r--r-- | weed/images/orientation_test.go | 5 | ||||
| -rw-r--r-- | weed/images/resizing_test.go | 5 |
2 files changed, 4 insertions, 6 deletions
diff --git a/weed/images/orientation_test.go b/weed/images/orientation_test.go index 32fa38f76..e9743bc0c 100644 --- a/weed/images/orientation_test.go +++ b/weed/images/orientation_test.go @@ -1,7 +1,6 @@ package images import ( - "io/ioutil" "os" "testing" ) @@ -9,11 +8,11 @@ import ( func TestXYZ(t *testing.T) { fname := "sample1.jpg" - dat, _ := ioutil.ReadFile(fname) + dat, _ := os.ReadFile(fname) fixed_data := FixJpgOrientation(dat) - ioutil.WriteFile("fixed1.jpg", fixed_data, 0644) + os.WriteFile("fixed1.jpg", fixed_data, 0644) os.Remove("fixed1.jpg") diff --git a/weed/images/resizing_test.go b/weed/images/resizing_test.go index d12f799d8..33b904445 100644 --- a/weed/images/resizing_test.go +++ b/weed/images/resizing_test.go @@ -2,7 +2,6 @@ package images import ( "bytes" - "io/ioutil" "os" "testing" ) @@ -10,13 +9,13 @@ import ( func TestResizing(t *testing.T) { fname := "sample2.webp" - dat, _ := ioutil.ReadFile(fname) + dat, _ := os.ReadFile(fname) resized, _, _ := Resized(".webp", bytes.NewReader(dat), 100, 30, "") buf := new(bytes.Buffer) buf.ReadFrom(resized) - ioutil.WriteFile("resized1.png", buf.Bytes(), 0644) + os.WriteFile("resized1.png", buf.Bytes(), 0644) os.Remove("resized1.png") |
