From d04bc0cbe35e5be46848117edac28a7f02e59b3c Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Tue, 26 Nov 2019 19:34:57 +0300 Subject: [PATCH] rpc: add marshaler for StackParamType Makes stack output look better, no one cares about numbers. --- pkg/rpc/stack_param.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/rpc/stack_param.go b/pkg/rpc/stack_param.go index 907e3e885..cf7e4c72c 100644 --- a/pkg/rpc/stack_param.go +++ b/pkg/rpc/stack_param.go @@ -89,6 +89,11 @@ func StackParamTypeFromString(s string) (StackParamType, error) { } } +// MarshalJSON implements the json.Marshaler interface. +func (t *StackParamType) MarshalJSON() ([]byte, error) { + return []byte(`"` + t.String() + `"`), nil +} + // UnmarshalJSON sets StackParamType from JSON-encoded data. func (t *StackParamType) UnmarshalJSON(data []byte) (err error) { var (