forked from TrueCloudLab/frostfs-node
[#772] node: Apply gofumpt
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
00aa6d9749
commit
79088baa06
136 changed files with 293 additions and 239 deletions
|
@ -50,12 +50,12 @@ func initConfig(cmd *cobra.Command, _ []string) error {
|
|||
}
|
||||
|
||||
pathDir := filepath.Dir(configPath)
|
||||
err = os.MkdirAll(pathDir, 0700)
|
||||
err = os.MkdirAll(pathDir, 0o700)
|
||||
if err != nil {
|
||||
return fmt.Errorf("create dir %s: %w", pathDir, err)
|
||||
}
|
||||
|
||||
f, err := os.OpenFile(configPath, os.O_RDWR|os.O_CREATE|os.O_TRUNC|os.O_SYNC, 0600)
|
||||
f, err := os.OpenFile(configPath, os.O_RDWR|os.O_CREATE|os.O_TRUNC|os.O_SYNC, 0o600)
|
||||
if err != nil {
|
||||
return fmt.Errorf("open %s: %w", configPath, err)
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ func initializeWallets(v *viper.Viper, walletDir string, size int) ([]string, er
|
|||
}
|
||||
|
||||
p := filepath.Join(walletDir, innerring.GlagoliticLetter(i).String()+".json")
|
||||
f, err := os.OpenFile(p, os.O_CREATE, 0644)
|
||||
f, err := os.OpenFile(p, os.O_CREATE, 0o644)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("can't create wallet file: %w", err)
|
||||
}
|
||||
|
|
|
@ -83,7 +83,7 @@ func newLocalClient(cmd *cobra.Command, v *viper.Viper, wallets []*wallet.Wallet
|
|||
go bc.Run()
|
||||
|
||||
if cmd.Name() != "init" {
|
||||
f, err := os.OpenFile(dumpPath, os.O_RDONLY, 0600)
|
||||
f, err := os.OpenFile(dumpPath, os.O_RDONLY, 0o600)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("can't open local dump: %w", err)
|
||||
}
|
||||
|
|
|
@ -15,16 +15,14 @@ import (
|
|||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
var (
|
||||
rootCmd = &cobra.Command{
|
||||
Use: "frostfs-adm",
|
||||
Short: "FrostFS Administrative Tool",
|
||||
Long: `FrostFS Administrative Tool provides functions to setup and
|
||||
var rootCmd = &cobra.Command{
|
||||
Use: "frostfs-adm",
|
||||
Short: "FrostFS Administrative Tool",
|
||||
Long: `FrostFS Administrative Tool provides functions to setup and
|
||||
manage FrostFS network deployment.`,
|
||||
RunE: entryPoint,
|
||||
SilenceUsage: true,
|
||||
}
|
||||
)
|
||||
RunE: entryPoint,
|
||||
SilenceUsage: true,
|
||||
}
|
||||
|
||||
func init() {
|
||||
cobra.OnInitialize(func() { initConfig(rootCmd) })
|
||||
|
|
|
@ -145,7 +145,7 @@ func storageConfig(cmd *cobra.Command, args []string) {
|
|||
}
|
||||
|
||||
out := applyTemplate(c)
|
||||
fatalOnErr(os.WriteFile(outPath, out, 0644))
|
||||
fatalOnErr(os.WriteFile(outPath, out, 0o644))
|
||||
|
||||
cmd.Println("Node is ready for work! Run `frostfs-node -config " + outPath + "`")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue