Skip to content

Commit

Permalink
Stop using ioutil
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacalz authored and whereswaldon committed Jan 6, 2025
1 parent 331bf46 commit 68fea01
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions harfbuzz/shaper_perf_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package harfbuzz

import (
"io/ioutil"
"os"
"testing"

"github.com/go-text/typesetting/font"
Expand Down Expand Up @@ -78,7 +78,7 @@ func shapeOne(b *testing.B, textFile, fontFile string, direction Direction, scri

font := NewFont(font.NewFace(ft))

textB, err := ioutil.ReadFile(textFile)
textB, err := os.ReadFile(textFile)
tu.AssertNoErr(b, err)

text := []rune(string(textB))
Expand Down
10 changes: 5 additions & 5 deletions segmenter/segmenter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package segmenter

import (
"fmt"
"io/ioutil"
"os"
"reflect"
"strconv"
"strings"
Expand Down Expand Up @@ -62,7 +62,7 @@ func collectWordBoundaries(s *Segmenter, input []rune) []bool {

func TestLineBreakUnicodeReference(t *testing.T) {
file := "test/LineBreakTest.txt"
b, err := ioutil.ReadFile(file)
b, err := os.ReadFile(file)
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -125,7 +125,7 @@ func parseUCDTestLine(t *testing.T, line string) (string, []string) {

func TestGraphemeBreakUnicodeReference(t *testing.T) {
file := "test/GraphemeBreakTest.txt"
b, err := ioutil.ReadFile(file)
b, err := os.ReadFile(file)
if err != nil {
t.Fatal(err)
}
Expand All @@ -147,7 +147,7 @@ func TestGraphemeBreakUnicodeReference(t *testing.T) {

func TestWordBreakUnicodeReference(t *testing.T) {
file := "test/WordBreakTest.txt"
b, err := ioutil.ReadFile(file)
b, err := os.ReadFile(file)
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -195,7 +195,7 @@ func lineSegmentCount(s *Segmenter, input []rune) int {

func getLineBreakInputs() [][]rune {
file := "test/LineBreakTest.txt"
by, err := ioutil.ReadFile(file)
by, err := os.ReadFile(file)
if err != nil {
panic(err)
}
Expand Down

0 comments on commit 68fea01

Please sign in to comment.