Skip to content

Commit

Permalink
fix: fix linter errot
Browse files Browse the repository at this point in the history
  • Loading branch information
andy89923 committed Apr 15, 2024
1 parent 5722cd6 commit b6c3f7f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions pkg/context/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"crypto/x509"
"encoding/pem"
"fmt"
"io/ioutil"
"math"
"math/big"
"net"
"os"
"strings"
"sync"

Expand Down Expand Up @@ -178,7 +178,7 @@ func InitN3IWFContext() bool {
keyPath = factory.N3iwfConfig.Configuration.PrivateKey
}

content, err := ioutil.ReadFile(keyPath)
content, err := os.ReadFile(keyPath)
if err != nil {
logger.CtxLog.Errorf("Cannot read private key data from file: %+v", err)
return false
Expand Down Expand Up @@ -220,7 +220,7 @@ func InitN3IWFContext() bool {
}

// Read .pem
content, err := ioutil.ReadFile(keyPath)
content, err := os.ReadFile(keyPath)
if err != nil {
logger.CtxLog.Errorf("Cannot read certificate authority data from file: %+v", err)
return false
Expand Down Expand Up @@ -259,7 +259,7 @@ func InitN3IWFContext() bool {
}

// Read .pem
content, err := ioutil.ReadFile(keyPath)
content, err := os.ReadFile(keyPath)
if err != nil {
logger.CtxLog.Errorf("Cannot read certificate data from file: %+v", err)
return false
Expand Down
6 changes: 3 additions & 3 deletions pkg/service/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package service
import (
"context"
"fmt"
"io/ioutil"
"io"
"net"
"os"
"os/signal"
Expand Down Expand Up @@ -43,15 +43,15 @@ func (a *N3iwfApp) 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)
}
}

Expand Down

0 comments on commit b6c3f7f

Please sign in to comment.