Skip to content

Commit

Permalink
Bump Go version in go.mod and fix staticcheck errors
Browse files Browse the repository at this point in the history
  • Loading branch information
bep committed Aug 7, 2024
1 parent 61e9648 commit e677800
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
6 changes: 2 additions & 4 deletions gen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ package main

import (
"fmt"
"io/ioutil"
"log"
"os"
"path"
Expand All @@ -30,7 +29,7 @@ func main() {
// directory.
//
// The custom bindings are named with a "a__" prefix. Keep those.
fis, err := ioutil.ReadDir(dstDir)
fis, err := os.ReadDir(dstDir)
if err != nil {
log.Fatal(err)
}
Expand Down Expand Up @@ -61,7 +60,7 @@ func main() {
filename = strings.TrimPrefix(filename, "/")
target := filepath.Join(dstDir, fi.Name())

if err := ioutil.WriteFile(target, []byte(fmt.Sprintf(`#ifndef LIBWEBP_NO_SRC
if err := os.WriteFile(target, []byte(fmt.Sprintf(`#ifndef LIBWEBP_NO_SRC
#include "../../libwebp_src/%s"
#endif
`, filename)), 0o644); err != nil {
Expand All @@ -70,7 +69,6 @@ func main() {

return nil
})

if err != nil {
log.Fatal(err)
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module github.com/bep/gowebp

go 1.16
go 1.20

require golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb // indirect
9 changes: 3 additions & 6 deletions libwebp/encode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ import (
"image"
"image/draw"
"image/jpeg"
_ "image/jpeg"
_ "image/png"
"io"
"io/ioutil"
"os"
"path/filepath"
"runtime"
Expand Down Expand Up @@ -108,7 +105,7 @@ func TestEncodeLongRunning(t *testing.T) {
t.Fatal(err)
}

if err = Encode(ioutil.Discard, img, test.opts); err != nil {
if err = Encode(io.Discard, img, test.opts); err != nil {
t.Fatal(err)
}
}
Expand Down Expand Up @@ -138,7 +135,7 @@ func BenchmarkEncode(b *testing.B) {

b.ResetTimer()
for i := 0; i < b.N; i++ {
if err = Encode(ioutil.Discard, imgrgba, test.opts); err != nil {
if err = Encode(io.Discard, imgrgba, test.opts); err != nil {
b.Fatal(err)
}
}
Expand All @@ -163,7 +160,7 @@ func BenchmarkEncodeJpeg(b *testing.B) {
}

for i := 0; i < b.N; i++ {
if err = jpeg.Encode(ioutil.Discard, img, opts); err != nil {
if err = jpeg.Encode(io.Discard, img, opts); err != nil {
b.Fatal(err)
}
}
Expand Down

0 comments on commit e677800

Please sign in to comment.