Skip to content
Snippets Groups Projects
Unverified Commit 01623fb2 authored by CTFang@WireLab's avatar CTFang@WireLab
Browse files

fix: fix linter error

parent 8729cdc4
No related branches found
No related tags found
No related merge requests found
package billing
import (
"io/ioutil"
"io"
"strconv"
"time"
......@@ -52,7 +52,7 @@ func PullCDRFile(c *ftp.ServerConn, fileName string) ([]byte, error) {
return nil, err
}
cdr, err1 := ioutil.ReadAll(r)
cdr, err1 := io.ReadAll(r)
return cdr, err1
}
......@@ -3,7 +3,6 @@ package billing
import (
"encoding/json"
"io/ioutil"
"os"
"strconv"
"sync"
......@@ -79,7 +78,7 @@ func OpenServer(wg *sync.WaitGroup) *BillingDomain {
return nil
}
if err := ioutil.WriteFile(confFile, file, 0o600); err != nil { //nolint: gomnd
if err := os.WriteFile(confFile, file, 0o600); err != nil { //nolint: gomnd
logger.BillingLog.Errorf("Couldn't create conf file %v", confFile)
return nil
}
......
......@@ -6,7 +6,7 @@ package factory
import (
"fmt"
"io/ioutil"
"os"
"github.com/asaskevich/govalidator"
"gopkg.in/yaml.v2"
......@@ -22,7 +22,7 @@ func InitConfigFactory(f string, cfg *Config) error {
// Use default config path
f = WebuiDefaultConfigPath
}
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)
......
package webui_service
import (
"io/ioutil"
"io"
"os"
"os/signal"
"runtime/debug"
......@@ -39,14 +39,14 @@ func (a *WebuiApp) 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
}
a.cfg.SetLogEnable(enable)
if enable {
logger.Log.SetOutput(os.Stderr)
} else {
logger.Log.SetOutput(ioutil.Discard)
logger.Log.SetOutput(io.Discard)
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment