Skip to content

Commit

Permalink
refactor: drop deprecated io/ioutil import & usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Omnikron13 committed Jul 20, 2024
1 parent 7ac17db commit a57b4fe
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions pixelview_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"flag"
"os"
"path/filepath"
"io/ioutil"
"image"
"image/color"
_ "image/png"
Expand Down Expand Up @@ -65,7 +64,7 @@ func TestFromFile(t *testing.T) {
}

if *update {
ioutil.WriteFile(golden, []byte(s), 0644)
os.WriteFile(golden, []byte(s), 0644)

Check failure on line 67 in pixelview_test.go

View workflow job for this annotation

GitHub Actions / Build

undefined: os.WriteFile
}
})
}
Expand All @@ -89,7 +88,7 @@ func TestFromImageGeneric(t *testing.T) {
}

if *update {
ioutil.WriteFile(golden, []byte(s), 0644)
os.WriteFile(golden, []byte(s), 0644)

Check failure on line 91 in pixelview_test.go

View workflow job for this annotation

GitHub Actions / Build

undefined: os.WriteFile
}
}

Expand All @@ -110,7 +109,7 @@ func TestFromPaletted(t *testing.T) {
}

if *update {
ioutil.WriteFile(golden, []byte(s), 0644)
os.WriteFile(golden, []byte(s), 0644)

Check failure on line 112 in pixelview_test.go

View workflow job for this annotation

GitHub Actions / Build

undefined: os.WriteFile
}
}

Expand All @@ -132,7 +131,7 @@ func TestFromNRGBA(t *testing.T) {
}

if *update {
ioutil.WriteFile(golden, []byte(s), 0644)
os.WriteFile(golden, []byte(s), 0644)

Check failure on line 134 in pixelview_test.go

View workflow job for this annotation

GitHub Actions / Build

undefined: os.WriteFile
}
}

Expand Down Expand Up @@ -200,7 +199,7 @@ func TestEncode(t *testing.T) {
func getTestData(t *testing.T, filename string) (img image.Image, reference, golden string) {
img = loadTestImage(t, filename)
golden = filepath.Join("testdata", filename+".golden")
buf, err := ioutil.ReadFile(golden)
buf, err := os.ReadFile(golden)

Check failure on line 202 in pixelview_test.go

View workflow job for this annotation

GitHub Actions / Build

undefined: os.ReadFile
if err != nil {
t.Error("Golden file could not be read")
}
Expand Down

0 comments on commit a57b4fe

Please sign in to comment.