fix for %v instead of %w

This commit is contained in:
Gregory Bednov 2025-07-15 15:05:19 +03:00
commit ac8a9610b9
3 changed files with 5 additions and 5 deletions

View file

@ -64,7 +64,7 @@ func newTendermint(app abci.Application, config *cfg.Config, laddrReturner chan
func GetNodeInfo(config *cfg.Config, dbPath string) (p2p.NodeInfo, error) {
db, err := openBadger(dbPath)
if err != nil {
return nil, fmt.Errorf("failed to open badger db to get node info", err)
return nil, fmt.Errorf("failed to open badger db to get node info %v", err)
}
defer db.Close()

View file

@ -20,7 +20,7 @@ var initCmd = &cobra.Command{
config, viper := cfg.InitGenesis(chainName, defaultConfigPath)
nodeinfo, err := blockchain.GetNodeInfo(config, dbPath)
if err != nil {
fmt.Printf("Error: %w", err)
fmt.Fprintf(os.Stderr, "Error: %v", err)
panic(err)
}
@ -28,14 +28,14 @@ var initCmd = &cobra.Command{
fmt.Println("Genesis node initialized.")
case "join":
if len(args) < 2 {
fmt.Println("Укажите путь к genesis.json")
fmt.Fprintln(os.Stderr, "Укажите путь к genesis.json")
os.Exit(1)
}
cfg.InitJoiner(chainName, defaultConfigPath, args[1])
fmt.Println("Joiner node initialized.")
default:
fmt.Printf("Неизвестный режим init: %s\n", args[0])
fmt.Fprintf(os.Stderr, "Неизвестный режим init: %s\n", args[0])
os.Exit(1)
}
},

View file

@ -46,7 +46,7 @@ var rootCmd = &cobra.Command{
config, err := cfg.ReadConfig(defaultConfigPath)
if err != nil {
fmt.Printf("конфигурация не прочитана: %w", err)
fmt.Fprintf(os.Stderr, "конфигурация не прочитана: %v", err)
}
ctx, cancel := context.WithCancel(context.Background())