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
Branches
Tags
No related merge requests found
package billing package billing
import ( import (
"io/ioutil" "io"
"strconv" "strconv"
"time" "time"
...@@ -52,7 +52,7 @@ func PullCDRFile(c *ftp.ServerConn, fileName string) ([]byte, error) { ...@@ -52,7 +52,7 @@ func PullCDRFile(c *ftp.ServerConn, fileName string) ([]byte, error) {
return nil, err return nil, err
} }
cdr, err1 := ioutil.ReadAll(r) cdr, err1 := io.ReadAll(r)
return cdr, err1 return cdr, err1
} }
...@@ -3,7 +3,6 @@ package billing ...@@ -3,7 +3,6 @@ package billing
import ( import (
"encoding/json" "encoding/json"
"io/ioutil"
"os" "os"
"strconv" "strconv"
"sync" "sync"
...@@ -79,7 +78,7 @@ func OpenServer(wg *sync.WaitGroup) *BillingDomain { ...@@ -79,7 +78,7 @@ func OpenServer(wg *sync.WaitGroup) *BillingDomain {
return nil 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) logger.BillingLog.Errorf("Couldn't create conf file %v", confFile)
return nil return nil
} }
......
...@@ -6,7 +6,7 @@ package factory ...@@ -6,7 +6,7 @@ package factory
import ( import (
"fmt" "fmt"
"io/ioutil" "os"
"github.com/asaskevich/govalidator" "github.com/asaskevich/govalidator"
"gopkg.in/yaml.v2" "gopkg.in/yaml.v2"
...@@ -22,7 +22,7 @@ func InitConfigFactory(f string, cfg *Config) error { ...@@ -22,7 +22,7 @@ func InitConfigFactory(f string, cfg *Config) error {
// Use default config path // Use default config path
f = WebuiDefaultConfigPath f = WebuiDefaultConfigPath
} }
if content, err := ioutil.ReadFile(f); err != nil { if content, err := os.ReadFile(f); err != nil {
return fmt.Errorf("[Factory] %+v", err) return fmt.Errorf("[Factory] %+v", err)
} else { } else {
logger.CfgLog.Infof("Read config from [%s]", f) logger.CfgLog.Infof("Read config from [%s]", f)
......
package webui_service package webui_service
import ( import (
"io/ioutil" "io"
"os" "os"
"os/signal" "os/signal"
"runtime/debug" "runtime/debug"
...@@ -39,14 +39,14 @@ func (a *WebuiApp) SetLogEnable(enable bool) { ...@@ -39,14 +39,14 @@ func (a *WebuiApp) SetLogEnable(enable bool) {
logger.MainLog.Infof("Log enable is set to [%v]", enable) logger.MainLog.Infof("Log enable is set to [%v]", enable)
if enable && logger.Log.Out == os.Stderr { if enable && logger.Log.Out == os.Stderr {
return return
} else if !enable && logger.Log.Out == ioutil.Discard { } else if !enable && logger.Log.Out == io.Discard {
return return
} }
a.cfg.SetLogEnable(enable) a.cfg.SetLogEnable(enable)
if enable { if enable {
logger.Log.SetOutput(os.Stderr) logger.Log.SetOutput(os.Stderr)
} else { } 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.
Please register or to comment