rpc: add marshaler for StackParamType
Makes stack output look better, no one cares about numbers.
This commit is contained in:
parent
d7d7215392
commit
d04bc0cbe3
1 changed files with 5 additions and 0 deletions
|
@ -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 (
|
||||
|
|
Loading…
Reference in a new issue