From efa55e02a513ccf24da3ee0144628a6895b66cab Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Wed, 24 Mar 2021 20:29:11 -0700 Subject: [PATCH] fix: omit empty pins slice when reporting pin progress Otherwise, we get messages of the form `{Pins: null, Progress: 100}`. After this change, we'll get `{Progress: 100}`. --- core/commands/pin/pin.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/commands/pin/pin.go b/core/commands/pin/pin.go index 409b75cc00d..dfeb69a95e4 100644 --- a/core/commands/pin/pin.go +++ b/core/commands/pin/pin.go @@ -44,8 +44,8 @@ type PinOutput struct { } type AddPinOutput struct { - Pins []string - Progress int `json:",omitempty"` + Pins []string `json:",omitempty"` + Progress int `json:",omitempty"` } const (