Skip to content

Commit

Permalink
dep: stdlib: remove io/ioutil usage
Browse files Browse the repository at this point in the history
  • Loading branch information
grokify committed Jan 14, 2024
1 parent 7212ae5 commit 8f94a80
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Expand Up @@ -11,7 +11,7 @@ jobs:
test:
strategy:
matrix:
go-version: [1.21.x, 1.19.x]
go-version: [1.21.x, 1.16.x]
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
Expand Down
5 changes: 2 additions & 3 deletions fancy/fancy.go
Expand Up @@ -11,7 +11,6 @@ package fancy
import (
"bufio"
"io"
"io/ioutil"
"os"
)

Expand Down Expand Up @@ -239,7 +238,7 @@ func ReadAndClose(f io.ReadCloser, err error) []byte {
if err != nil {
return []byte{}
}
r, _ := ioutil.ReadAll(f)
r, _ := io.ReadAll(f)
f.Close()
return r
}
Expand All @@ -257,7 +256,7 @@ func FileReader(fn string) Reader {
}

func ReadAll(f io.Reader) []byte {
r, _ := ioutil.ReadAll(f)
r, _ := io.ReadAll(f)
return r
}

Expand Down
4 changes: 2 additions & 2 deletions svgtext/svgtext.go
Expand Up @@ -9,7 +9,7 @@
package svgtext

import (
"io/ioutil"
"os"

"github.com/grokify/pdfreader"
"github.com/grokify/pdfreader/cmapi"
Expand Down Expand Up @@ -79,7 +79,7 @@ func fontnamemap(fn string) int {
styles = make(map[string]string)
}

data, _ := ioutil.ReadFile(fn)
data, _ := os.ReadFile(fn)
no := 0
for p := 0; p < len(data); {
n := string(csvtok(data[p:]))
Expand Down
3 changes: 1 addition & 2 deletions tt1/tt1.go
Expand Up @@ -10,7 +10,6 @@ package main

import (
"fmt"
"io/ioutil"
"os"

"github.com/grokify/pdfreader/fancy"
Expand Down Expand Up @@ -44,7 +43,7 @@ func dumpT1(i *type1.TypeOneI) {
}

func main() {
a, _ := ioutil.ReadFile(os.Args[1])
a, _ := os.ReadFile(os.Args[1])
if a[0] == 128 {
a = pfb.Decode(a)
}
Expand Down

0 comments on commit 8f94a80

Please sign in to comment.