Skip to content

Commit

Permalink
Removed deprecated methods
Browse files Browse the repository at this point in the history
  • Loading branch information
msoap committed Sep 3, 2022
1 parent 7871810 commit 7075de8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions go-carpet.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"flag"
"fmt"
"go/build"
"io/ioutil"
"io"
"log"
"os"
"os/exec"
Expand Down Expand Up @@ -77,7 +77,7 @@ func readFile(fileName string) (result []byte, err error) {
return result, err
}

result, err = ioutil.ReadAll(fileReader)
result, err = io.ReadAll(fileReader)
if err == nil {
err = fileReader.Close()
}
Expand Down Expand Up @@ -336,7 +336,7 @@ func getFileFuncRanges(fileBytes []byte, funcs []string) (result []textRange, er
}

func getTempFileName() (string, error) {
tmpFile, err := ioutil.TempFile(".", "go-carpet-coverage-out-")
tmpFile, err := os.CreateTemp(".", "go-carpet-coverage-out-")
if err != nil {
return "", err
}
Expand Down
4 changes: 2 additions & 2 deletions utils_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
"io/ioutil"
"io"
"log"
"os"
"reflect"
Expand Down Expand Up @@ -165,7 +165,7 @@ func Test_parseAdditionalArgs(t *testing.T) {
},
}

log.SetOutput(ioutil.Discard)
log.SetOutput(io.Discard)

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down

0 comments on commit 7075de8

Please sign in to comment.