refactor: move from io/ioutil to io and os packages

The io/ioutil package has been deprecated as of Go 1.16, see
https://golang.org/doc/go1.16#ioutil. This commit replaces the existing
io/ioutil functions with their new definitions in io and os packages.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
Eng Zer Jun
2021-12-03 14:44:17 +08:00
parent 5eb7763052
commit 7a05bdcb82
15 changed files with 33 additions and 35 deletions

View File

@ -2,7 +2,6 @@ package config
import (
"errors"
"io/ioutil"
"log"
"os"
"time"
@ -142,7 +141,7 @@ func LoadDefaultConfiguration() (*Config, error) {
func readConfigurationFile(fileName string) (config *Config, err error) {
var bytes []byte
if bytes, err = ioutil.ReadFile(fileName); err == nil {
if bytes, err = os.ReadFile(fileName); err == nil {
// file exists, so we'll parse it and return it
return parseAndValidateConfigBytes(bytes)
}