|
|
|
|
|
|
|
|
|
|
|
| |
After tls.Unmarshal() an empty slice is not assigned the nil value, but rather
a slice of zero length. It is in contrast to NewTreeHeadV1(), which assigns a
nil value. Therefore, reflect.DeepEqual() considers them to be different.
Fixed by assigning an empty tree head extension as `make([]byte, 0)`,
and not looking for nil values but rather zero-length values with len().
Further read: "Note that a non-nil empty slice and a nil slice [...] are
not deeply equal." (https://golang.org/pkg/reflect/#DeepEqual).
|