Skip to content

Commit

Permalink
Fix fordbid for stellar/go/support/errors
Browse files Browse the repository at this point in the history
  • Loading branch information
2opremio committed Jun 18, 2024
1 parent f6fad08 commit 19b5c3e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
11 changes: 6 additions & 5 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,12 @@ linters-settings:
# Default: ["^(fmt\\.Print(|f|ln)|print|println)$"]
forbid:
- p: "^(fmt\\.Print(|f|ln)|print|println)$"
msg: Do not commit debug print statements.
- p: .*
pkg: ^stellar/go/support/errors$
message: use standard errors package and fmt.Errorf().
msg: Do not commit debug print statements (in tests use t.Log()).
- p: "^.*$"
pkg: "^github.com/stellar/go/support/errors$"
msg: Do not use stellar/go/support/errors, use the standard 'errors' package and fmt.Errorf().
exclude-godoc-examples: false
analyze-types: true

linters:
enable-all: true
Expand All @@ -94,7 +95,7 @@ linters:
# exhaustruct: enforcing exhaustive fields is useful in some cases, but there are
# too many legitimate default field values in Go
- exhaustruct
# err113: Enforcing errors.Is() is useful but cannot be enabled in isoation
# err113: Enforcing errors.Is() is useful but cannot be enabled in isolation
- err113
- thelper
- wsl
Expand Down
7 changes: 4 additions & 3 deletions cmd/soroban-rpc/internal/config/config_option.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package config

import (
"errors"
"fmt"
"reflect"
"strconv"
"time"

"github.com/spf13/pflag"

"github.com/stellar/go/support/errors"
"github.com/stellar/go/support/strutils"
)

Expand Down Expand Up @@ -95,11 +96,11 @@ func (o *ConfigOption) setValue(i interface{}) (err error) {
return
}

err = errors.Errorf("config option setting error ('%s') %v", o.Name, recoverRes)
err = fmt.Errorf("config option setting error ('%s') %v", o.Name, recoverRes)
}
}()
parser := func(option *ConfigOption, i interface{}) error {
return errors.Errorf("no parser for flag %s", o.Name)
return fmt.Errorf("no parser for flag %s", o.Name)
}
switch o.ConfigKey.(type) {
case *bool:
Expand Down

0 comments on commit 19b5c3e

Please sign in to comment.