Skip to content

Commit

Permalink
Self-review errors.As pointer usage
Browse files Browse the repository at this point in the history
  • Loading branch information
qdm12 committed Jan 20, 2025
1 parent d46e1b0 commit 4209f1c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion p2p/dnsdisc/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ type nameError struct {
}

func (err nameError) Error() string {
ee := new(entryError)
var ee entryError
if errors.As(err.err, &ee) {
return fmt.Sprintf("invalid %s entry at %s: %v", ee.typ, err.name, ee.err)
}
Expand Down
2 changes: 1 addition & 1 deletion rlp/typecache.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func structFields(typ reflect.Type) (fields []field, err error) {
// Filter/validate fields.
structFields, structTags, err := rlpstruct.ProcessFields(allStructFields)
if err != nil {
tagErr := new(rlpstruct.TagError)
var tagErr rlpstruct.TagError
if errors.As(err, &tagErr) {
tagErr.StructType = typ.String()
return nil, tagErr
Expand Down

0 comments on commit 4209f1c

Please sign in to comment.