-
Notifications
You must be signed in to change notification settings - Fork 363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: add errorlint and make fmt.Errorf use %w to wrap error instead of %v #878
Conversation
cmd/dymd/cmd/inspect.go
Outdated
@@ -69,7 +69,7 @@ func InspectCmd(appExporter types.AppExporter, appCreator types.AppCreator, defa | |||
height, _ := cmd.Flags().GetInt64(FlagHeight) | |||
exported, err := appExporter(serverCtx.Logger, db, traceWriter, height, false, []string{}, serverCtx.Viper) | |||
if err != nil { | |||
return fmt.Errorf("error exporting state: %v", err) | |||
return fmt.Errorf("error exporting state: %w", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove error
cmd/dymd/cmd/inspect.go
Outdated
@@ -116,7 +116,7 @@ func InspectCmd(appExporter types.AppExporter, appCreator types.AppCreator, defa | |||
dataDir := filepath.Join(config.RootDir, "data") | |||
directories, err := os.ReadDir(dataDir) | |||
if err != nil { | |||
return fmt.Errorf("Error reading directory: %v", err) | |||
return fmt.Errorf("error reading directory: %w", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove error
cmd/dymd/cmd/inspect.go
Outdated
@@ -69,7 +69,7 @@ func InspectCmd(appExporter types.AppExporter, appCreator types.AppCreator, defa | |||
height, _ := cmd.Flags().GetInt64(FlagHeight) | |||
exported, err := appExporter(serverCtx.Logger, db, traceWriter, height, false, []string{}, serverCtx.Viper) | |||
if err != nil { | |||
return fmt.Errorf("error exporting state: %v", err) | |||
return fmt.Errorf("error exporting state: %w", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return fmt.Errorf("error exporting state: %w", err) | |
return fmt.Errorf("exporting state: %w", err) |
cmd/dymd/cmd/inspect.go
Outdated
@@ -116,7 +116,7 @@ func InspectCmd(appExporter types.AppExporter, appCreator types.AppCreator, defa | |||
dataDir := filepath.Join(config.RootDir, "data") | |||
directories, err := os.ReadDir(dataDir) | |||
if err != nil { | |||
return fmt.Errorf("Error reading directory: %v", err) | |||
return fmt.Errorf("error reading directory: %w", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return fmt.Errorf("error reading directory: %w", err) | |
return fmt.Errorf("reading directory: %w", err) |
Thank @danwt for feedback, i updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gj!
thanks @hoank101. can you please resolve conflicts? |
… hoa/refactor-error # Conflicts: # .golangci.yml
yeah, resolved |
@hoank101 you should re-request review if you want review again |
Description
Closes #XXX
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow-up issues.
PR review checkboxes:
I have...
Unreleased
section inCHANGELOG.md
godoc
commentsSDK Checklist
map
time.Now()
sendCoin
and notSendCoins
Full security checklist here
----;
For Reviewer:
---;
After reviewer approval: