Skip to content

Commit

Permalink
fix: fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
RiccardoM authored and MonikaCat committed Dec 22, 2023
1 parent 362b71c commit 3e7b58c
Show file tree
Hide file tree
Showing 6 changed files with 8 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
2 changes: 1 addition & 1 deletion database/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func NewDatabaseConfig(
}
}

func (c Config) WithUrl(url string) Config {
func (c Config) WithURL(url string) Config {
c.URL = url
return c
}
Expand Down
2 changes: 1 addition & 1 deletion database/postgresql/postgresql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (suite *DbTestSuite) SetupTest() {

// Build the database config
dbCfg := databaseconfig.DefaultDatabaseConfig().
WithUrl("postgres://bdjuno:password@localhost:6433/bdjuno?sslmode=disable&search_path=public")
WithURL("postgres://bdjuno:password@localhost:6433/bdjuno?sslmode=disable&search_path=public")

// Build the database
db, err := postgres.Builder(database.NewContext(dbCfg, &codec, logging.DefaultLogger()))
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

0 comments on commit 3e7b58c

Please sign in to comment.