diff --git a/pkg/factory/factory.go b/pkg/factory/factory.go index 52f3c0ae..15d6fa70 100644 --- a/pkg/factory/factory.go +++ b/pkg/factory/factory.go @@ -6,7 +6,7 @@ package factory import ( "fmt" - "io/ioutil" + "os" "github.com/asaskevich/govalidator" "gopkg.in/yaml.v2" @@ -23,7 +23,7 @@ func InitConfigFactory(f string, cfg *Config) error { f = AmfDefaultConfigPath } - if content, err := ioutil.ReadFile(f); err != nil { + if content, err := os.ReadFile(f); err != nil { return fmt.Errorf("[Factory] %+v", err) } else { logger.CfgLog.Infof("Read config from [%s]", f) diff --git a/pkg/service/init.go b/pkg/service/init.go index 82e79342..00de516a 100644 --- a/pkg/service/init.go +++ b/pkg/service/init.go @@ -2,7 +2,7 @@ package service import ( "fmt" - "io/ioutil" + "io" "os" "os/signal" "runtime/debug" @@ -50,7 +50,7 @@ func (a *AmfApp) SetLogEnable(enable bool) { logger.MainLog.Infof("Log enable is set to [%v]", enable) if enable && logger.Log.Out == os.Stderr { return - } else if !enable && logger.Log.Out == ioutil.Discard { + } else if !enable && logger.Log.Out == io.Discard { return } @@ -58,7 +58,7 @@ func (a *AmfApp) SetLogEnable(enable bool) { if enable { logger.Log.SetOutput(os.Stderr) } else { - logger.Log.SetOutput(ioutil.Discard) + logger.Log.SetOutput(io.Discard) } }