diff --git a/cmd/init/cmd.go b/cmd/init/cmd.go index a7ffcd91..4569298f 100644 --- a/cmd/init/cmd.go +++ b/cmd/init/cmd.go @@ -2,7 +2,6 @@ package init import ( "fmt" - "io/ioutil" "os" "github.com/forbole/juno/v4/types/config" @@ -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) } diff --git a/cmd/migrate/v3/utils.go b/cmd/migrate/v3/utils.go index a2d32bde..9c69b10a 100644 --- a/cmd/migrate/v3/utils.go +++ b/cmd/migrate/v3/utils.go @@ -2,7 +2,6 @@ package v3 import ( "fmt" - "io/ioutil" "os" "path" @@ -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) } diff --git a/cmd/migrate/v4/migrate.go b/cmd/migrate/v4/migrate.go index 4df0ff7a..0cf9c1a7 100644 --- a/cmd/migrate/v4/migrate.go +++ b/cmd/migrate/v4/migrate.go @@ -2,7 +2,7 @@ package v4 import ( "fmt" - "io/ioutil" + "os" parsecmdtypes "github.com/forbole/juno/v4/cmd/parse/types" @@ -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) } diff --git a/node/builder/builder.go b/node/builder/builder.go index bd3ef5ba..6d7ef1af 100644 --- a/node/builder/builder.go +++ b/node/builder/builder.go @@ -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" ) diff --git a/types/config/parser.go b/types/config/parser.go index 769d0af9..33220c46 100644 --- a/types/config/parser.go +++ b/types/config/parser.go @@ -2,7 +2,7 @@ package config import ( "fmt" - "io/ioutil" + "os" "gopkg.in/yaml.v3" ) @@ -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) } diff --git a/types/utils.go b/types/utils.go index e79588f6..80560768 100644 --- a/types/utils.go +++ b/types/utils.go @@ -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 } } diff --git a/types/utils/utils.go b/types/utils/utils.go index 7222c8ad..3254aae0 100644 --- a/types/utils/utils.go +++ b/types/utils/utils.go @@ -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 } }