Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
MonikaCat committed Jun 20, 2023
1 parent f465547 commit 232efea
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 10 deletions.
3 changes: 1 addition & 2 deletions cmd/init/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package init

import (
"fmt"
"io/ioutil"
"os"

"github.com/forbole/juno/v4/types/config"
Expand Down Expand Up @@ -62,5 +61,5 @@ func writeConfig(cfg WritableConfig, path string) error {
return err
}

return ioutil.WriteFile(path, bz, 0600)
return os.WriteFile(path, bz, 0600)
}
3 changes: 1 addition & 2 deletions cmd/migrate/v3/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package v3

import (
"fmt"
"io/ioutil"
"os"
"path"

Expand All @@ -20,7 +19,7 @@ func GetConfig() (Config, error) {
return Config{}, fmt.Errorf("config file does not exist")
}

bz, err := ioutil.ReadFile(file)
bz, err := os.ReadFile(file)
if err != nil {
return Config{}, fmt.Errorf("error while reading config files: %s", err)
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/migrate/v4/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package v4

import (
"fmt"
"io/ioutil"
"os"

parsecmdtypes "github.com/forbole/juno/v4/cmd/parse/types"

Expand Down Expand Up @@ -32,7 +32,7 @@ func RunMigration(parseConfig *parsecmdtypes.Config) error {
return fmt.Errorf("error while serializing config: %s", err)
}

err = ioutil.WriteFile(config.GetConfigFilePath(), bz, 0600)
err = os.WriteFile(config.GetConfigFilePath(), bz, 0600)
if err != nil {
return fmt.Errorf("error while writing v4 config: %s", err)
}
Expand Down
1 change: 1 addition & 0 deletions node/builder/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/forbole/juno/v4/node"
nodeconfig "github.com/forbole/juno/v4/node/config"

// "github.com/forbole/juno/v4/node/local"
"github.com/forbole/juno/v4/node/remote"
)
Expand Down
4 changes: 2 additions & 2 deletions types/config/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package config

import (
"fmt"
"io/ioutil"
"os"

"gopkg.in/yaml.v3"
)
Expand All @@ -26,7 +26,7 @@ func Read(configPath string, parser Parser) (Config, error) {
return Config{}, fmt.Errorf("empty configuration path")
}

configData, err := ioutil.ReadFile(configPath)
configData, err := os.ReadFile(configPath)
if err != nil {
return Config{}, fmt.Errorf("failed to read config: %s", err)
}
Expand Down
2 changes: 1 addition & 1 deletion types/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func FindEventsByType(events []abci.Event, eventType string) []abci.Event {

func FindAttributeByKey(event abci.Event, attrKey string) (abci.EventAttribute, error) {
for _, attr := range event.Attributes {
if string(attr.Key) == attrKey {
if attr.Key == attrKey {
return attr, nil
}
}
Expand Down
2 changes: 1 addition & 1 deletion types/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func FindEventsByType(events []abci.Event, eventType string) []abci.Event {

func FindAttributeByKey(event abci.Event, attrKey string) (abci.EventAttribute, error) {
for _, attr := range event.Attributes {
if string(attr.Key) == attrKey {
if attr.Key == attrKey {
return attr, nil
}
}
Expand Down

0 comments on commit 232efea

Please sign in to comment.