From af3a65297bbc554bc00aeb31b175662c6d3d0e94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Danis?= Date: Sun, 17 Feb 2019 10:38:24 +0100 Subject: [PATCH] cmd: Fix dump of void slice MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Frédéric Danis --- cmd/debos/debos.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/debos/debos.go b/cmd/debos/debos.go index 1184134..d710f38 100644 --- a/cmd/debos/debos.go +++ b/cmd/debos/debos.go @@ -110,7 +110,7 @@ func DumpActionFields(iface interface{}, depth int) { case reflect.Slice: s := reflect.ValueOf(f.Interface()) - if s.Index(0).Kind() == reflect.Struct { + if s.Len() > 0 && s.Index(0).Kind() == reflect.Struct { log.Printf(" %s:\n", entries.Type().Field(i).Name) for j := 0; j < s.Len(); j++ { if s.Index(j).Kind() == reflect.Struct {