Skip to content
This repository was archived by the owner on Jun 27, 2023. It is now read-only.

Commit e7cbbd8

Browse files
committed
fix: properly emit JSON strings for empty maps in pin and pinStatus objects
1 parent 3b1cff0 commit e7cbbd8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

model.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func (p *pinObject) MarshalJSON() ([]byte, error) {
3636
}
3737
}
3838

39-
var metaStr string
39+
metaStr := "{}"
4040
if meta := p.GetMeta(); meta != nil {
4141
metaBytes, err := json.Marshal(meta)
4242
if err == nil {
@@ -138,7 +138,7 @@ func (p *pinStatusObject) MarshalJSON() ([]byte, error) {
138138
}
139139
}
140140

141-
var infoStr string
141+
infoStr := "{}"
142142
if info := p.GetInfo(); info != nil {
143143
infoBytes, err := json.Marshal(info)
144144
if err == nil {

0 commit comments

Comments
 (0)