From 29b7e1732379765a93a03b749c267550996a754f Mon Sep 17 00:00:00 2001 From: Julian Daube Date: Mon, 20 Mar 2017 11:55:47 +0100 Subject: [PATCH] Made output of nil Meta maps useful --- cmd/apiserver/main.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/apiserver/main.go b/cmd/apiserver/main.go index 6fcd64c..58a5a20 100644 --- a/cmd/apiserver/main.go +++ b/cmd/apiserver/main.go @@ -182,6 +182,12 @@ func (h Handler) Meta(resp http.ResponseWriter, path []string) { } cached: + if meta == nil { + // make output useful for nil maps + fmt.Fprint(resp, "[]") + return + } + encoder := json.NewEncoder(resp) if len(path) > 1 {