Skip to content

Commit

Permalink
Run go staticcheck & removing reported warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Avinash041 committed Oct 19, 2023
1 parent 78a6a67 commit 5ebc39a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ func main() {
},
}

rand.Seed(time.Now().UnixNano())
// rand.Seed(time.Now().UnixNano()) // rand.Seed has been deprecated
randSeed := rand.New(rand.NewSource(time.Now().UnixNano()))
randSeed.Uint64()

if err := app.Run(os.Args); err != nil {
logger.MainLog.Errorf("UPF Cli Run Error: %v", err)
Expand Down
4 changes: 2 additions & 2 deletions pkg/factory/factory.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package factory

import (
"io/ioutil"
"net"
"os"

"github.com/asaskevich/govalidator"
"github.com/pkg/errors"
Expand All @@ -18,7 +18,7 @@ func InitConfigFactory(f string, cfg *Config) error {
f = UpfDefaultConfigPath
}

if content, err := ioutil.ReadFile(f); err != nil {
if content, err := os.ReadFile(f); err != nil {
return errors.Errorf("[Factory] %+v", err)
} else {
logger.CfgLog.Infof("Read config from [%s]", f)
Expand Down

0 comments on commit 5ebc39a

Please sign in to comment.