Skip to content

Commit cce7f08

Browse files
authored
rlp/rlpgen: fix error handling when target type not found (#25547)
typ will be nil when lookupStructType returns an error. cfg.Type should be used instead.
1 parent 23ac8df commit cce7f08

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rlp/rlpgen/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ func (cfg *Config) process() (code []byte, err error) {
106106
// Find the type and generate.
107107
typ, err := lookupStructType(pkg.Scope(), cfg.Type)
108108
if err != nil {
109-
return nil, fmt.Errorf("can't find %s in %s: %v", typ, pkg, err)
109+
return nil, fmt.Errorf("can't find %s in %s: %v", cfg.Type, pkg, err)
110110
}
111111
code, err = bctx.generate(typ, cfg.GenerateEncoder, cfg.GenerateDecoder)
112112
if err != nil {

0 commit comments

Comments
 (0)