Skip to content

Instantly share code, notes, and snippets.

@fjl
Created January 25, 2022 10:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fjl/10f4b78e54b2ad7113a1b95e3fcaebcd to your computer and use it in GitHub Desktop.
Save fjl/10f4b78e54b2ad7113a1b95e3fcaebcd to your computer and use it in GitHub Desktop.
diff --git a/rlp/encode.go b/rlp/encode.go
index c3523369f..404202418 100644
--- a/rlp/encode.go
+++ b/rlp/encode.go
@@ -399,7 +399,8 @@ func makeEncoderWriter(typ reflect.Type) writer {
// package json simply doesn't call MarshalJSON for this case, but encodes the
// value as if it didn't implement the interface. We don't want to handle it that
// way.
- return fmt.Errorf("rlp: unadressable value of type %v, EncodeRLP is pointer method", val.Type())
+ panic(fmt.Errorf("rlp: unadressable value of type %v, EncodeRLP is pointer method", val.Type()))
+ return nil
}
return val.Addr().Interface().(Encoder).EncodeRLP(w)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment