Skip to content

Commit

Permalink
get rid of io.ReadAll
Browse files Browse the repository at this point in the history
  • Loading branch information
swinkelhofer committed Oct 17, 2021
1 parent 2337a4c commit 0a1469c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
go-version: 1.16

- name: Test
run: go test -v ./...
Expand Down
3 changes: 2 additions & 1 deletion pkg/resources/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ package resources

import (
"io"
"io/ioutil"
"os"
"strconv"
"strings"
Expand All @@ -23,7 +24,7 @@ func readUint64FromFile(file *os.File) (uint64, error) {
if _, err = file.Seek(0, io.SeekStart); err != nil {
return 0, err
}
if rawNumber, err = io.ReadAll(file); err != nil {
if rawNumber, err = ioutil.ReadAll(file); err != nil {
return 0, err
}
if number, err = strconv.ParseUint(strings.TrimSpace(string(rawNumber)), 10, 64); err != nil {
Expand Down

0 comments on commit 0a1469c

Please sign in to comment.