From 678ca9feff0f502069e22c126cf9155a393b2711 Mon Sep 17 00:00:00 2001 From: Conner Fromknecht Date: Fri, 26 Apr 2019 17:20:23 -0700 Subject: [PATCH] channeldb/codec: add NewUnknownElementType constructor --- channeldb/codec.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/channeldb/codec.go b/channeldb/codec.go index f491a8c15..1da362dd7 100644 --- a/channeldb/codec.go +++ b/channeldb/codec.go @@ -51,6 +51,12 @@ type UnknownElementType struct { element interface{} } +// NewUnknownElementType creates a new UnknownElementType error from the passed +// method name and element. +func NewUnknownElementType(method string, el interface{}) UnknownElementType { + return UnknownElementType{method: method, element: el} +} + // Error returns the name of the method that encountered the error, as well as // the type that was unsupported. func (e UnknownElementType) Error() string {