Unverified Commit cce7f084 authored by Justin Traglia's avatar Justin Traglia Committed by GitHub

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.
parent 23ac8df1
......@@ -106,7 +106,7 @@ func (cfg *Config) process() (code []byte, err error) {
// Find the type and generate.
typ, err := lookupStructType(pkg.Scope(), cfg.Type)
if err != nil {
return nil, fmt.Errorf("can't find %s in %s: %v", typ, pkg, err)
return nil, fmt.Errorf("can't find %s in %s: %v", cfg.Type, pkg, err)
}
code, err = bctx.generate(typ, cfg.GenerateEncoder, cfg.GenerateDecoder)
if err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment