Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-pinning-service-http-client
Commits
c86fa75a
Commit
c86fa75a
authored
Sep 10, 2020
by
Adin Schmahmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: properly emit JSON strings for empty maps in pin and pinStatus objects
parent
fa6705a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
model.go
model.go
+2
-2
No files found.
model.go
View file @
c86fa75a
...
@@ -36,7 +36,7 @@ func (p *pinObject) MarshalJSON() ([]byte, error) {
...
@@ -36,7 +36,7 @@ func (p *pinObject) MarshalJSON() ([]byte, error) {
}
}
}
}
var
metaStr
string
metaStr
:=
"{}"
if
meta
:=
p
.
GetMeta
();
meta
!=
nil
{
if
meta
:=
p
.
GetMeta
();
meta
!=
nil
{
metaBytes
,
err
:=
json
.
Marshal
(
meta
)
metaBytes
,
err
:=
json
.
Marshal
(
meta
)
if
err
==
nil
{
if
err
==
nil
{
...
@@ -138,7 +138,7 @@ func (p *pinStatusObject) MarshalJSON() ([]byte, error) {
...
@@ -138,7 +138,7 @@ func (p *pinStatusObject) MarshalJSON() ([]byte, error) {
}
}
}
}
var
infoStr
string
infoStr
:=
"{}"
if
info
:=
p
.
GetInfo
();
info
!=
nil
{
if
info
:=
p
.
GetInfo
();
info
!=
nil
{
infoBytes
,
err
:=
json
.
Marshal
(
info
)
infoBytes
,
err
:=
json
.
Marshal
(
info
)
if
err
==
nil
{
if
err
==
nil
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment