From db5da01132679185fe61727c6fa611390a0a8b01 Mon Sep 17 00:00:00 2001 From: Chris O'Hara Date: Thu, 23 Nov 2023 13:21:10 +1000 Subject: [PATCH] Make a note about derived types --- types/inspect.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/types/inspect.go b/types/inspect.go index c92f892..a40d990 100644 --- a/types/inspect.go +++ b/types/inspect.go @@ -124,7 +124,8 @@ type Type struct { index int } -// Index is the index of the type in the serialized state. +// Index is the index of the type in the serialized state, or -1 +// if the type is derived from a serialized type. func (t *Type) Index() int { return t.index } @@ -960,6 +961,7 @@ func (s *Scanner) readType() (ok bool) { return false } t := s.state.Type(int(id - 1)) + len, ok := s.getVarint() if !ok { return false