Skip to content

Commit

Permalink
chore: fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
simlecode committed Dec 28, 2022
1 parent b918374 commit 8caa15b
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 12 deletions.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ show-env:
@echo '-------------------------------------------------'

lint:
gofmt -s -w ./
golangci-lint run

clean:
Expand Down
3 changes: 1 addition & 2 deletions cli/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"os"
"strings"

Expand Down Expand Up @@ -233,7 +232,7 @@ var walletImport = &cli.Command{
inpdata = indata

} else {
fdata, err := ioutil.ReadFile(cctx.Args().First())
fdata, err := os.ReadFile(cctx.Args().First())
if err != nil {
if strings.Contains(err.Error(), "no such file or directory") {
return errors.New("input whether it is a file, if not, exec `./venus-wallet import` and then `enter` ")
Expand Down
5 changes: 2 additions & 3 deletions example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"crypto/sha256"
"fmt"
"io/ioutil"
"log"
"os"
"os/exec"
Expand Down Expand Up @@ -79,12 +78,12 @@ func main() {
if err != nil {
log.Fatal(err)
}
tb, err := ioutil.ReadFile(path.Join(dir, "example", "remote-token.tmp"))
tb, err := os.ReadFile(path.Join(dir, "example", "remote-token.tmp"))
if err != nil {
log.Fatal(err)
}
token := strings.TrimSpace(string(tb))
pb, err := ioutil.ReadFile(path.Join(dir, "example", "pid.tmp"))
pb, err := os.ReadFile(path.Join(dir, "example", "pid.tmp"))
if err != nil {
log.Fatal(err)
}
Expand Down
3 changes: 1 addition & 2 deletions filemgr/fs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
package filemgr

import (
"io/ioutil"
"os"
"testing"

Expand All @@ -12,7 +11,7 @@ import (

func TestNewFS(t *testing.T) {
// stm: @VENUSWALLET_FILEMGR_FS_NEW_001
fsPath, err := ioutil.TempDir("", "venus-repo-")
fsPath, err := os.MkdirTemp("", "venus-repo-")
defer os.RemoveAll(fsPath)
if err != nil {
t.Fatal(err)
Expand Down
3 changes: 1 addition & 2 deletions filemgr/jwt.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"crypto/rand"
"encoding/hex"
"io"
"io/ioutil"

"github.com/filecoin-project/venus-wallet/config"
"github.com/filecoin-project/venus/venus-shared/api/permission"
Expand All @@ -22,7 +21,7 @@ type jwtSecret struct {

// Random generation of secret keys
func randSecret() (*jwtSecret, error) {
sk, err := ioutil.ReadAll(io.LimitReader(rand.Reader, 32))
sk, err := io.ReadAll(io.LimitReader(rand.Reader, 32))
if err != nil {
return nil, err
}
Expand Down
3 changes: 1 addition & 2 deletions integration_test/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package integration
import (
"context"
"fmt"
"io/ioutil"
"os"
"strings"
"syscall"
Expand Down Expand Up @@ -104,7 +103,7 @@ func (inst *WalletInst) StopAndWait() error {
}

func NewWalletInst() (*WalletInst, error) {
dir, err := ioutil.TempDir("", "venus_wallet_")
dir, err := os.MkdirTemp("", "venus_wallet_")
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 8caa15b

Please sign in to comment.