cleanup: use os.ReadFile to read file

as ioutil.ReadFile is deprecated and
suggestion is to use os.ReadFile as
per https://pkg.go.dev/io/ioutil updating
the same.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna
2022-01-21 15:02:34 +05:30
committed by mergify[bot]
parent 562dff0d19
commit aba6979d29
10 changed files with 17 additions and 23 deletions

View File

@ -15,7 +15,6 @@ package log
import (
"compress/gzip"
"io/ioutil"
"os"
"strings"
)
@ -24,7 +23,7 @@ import (
// compressed format.
func GzipLogFile(pathToFile string) error {
// Get all the bytes from the file.
content, err := ioutil.ReadFile(pathToFile) // #nosec:G304, file inclusion via variable.
content, err := os.ReadFile(pathToFile) // #nosec:G304, file inclusion via variable.
if err != nil {
return err
}