aboutsummaryrefslogtreecommitdiffstats
path: root/marshall_test.go
diff options
context:
space:
mode:
authorGuillaume Horel <guillaume.horel@gmail.com>2016-12-12 22:22:41 -0500
committerGuillaume Horel <guillaume.horel@gmail.com>2016-12-12 22:22:41 -0500
commit6bb509f48f20a20e16b447ddcecbf3d55a4aa0a3 (patch)
tree8c4e9a6f94a88053695e5359ac0f2d9561b025fe /marshall_test.go
parent7034036c50f857456fb6c4cb45c39d6ac911bbe9 (diff)
downloadlastfm-api-6bb509f48f20a20e16b447ddcecbf3d55a4aa0a3.tar.gz
tweak marshalling
Diffstat (limited to 'marshall_test.go')
-rw-r--r--marshall_test.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/marshall_test.go b/marshall_test.go
index b5e9fae..ad4d6fd 100644
--- a/marshall_test.go
+++ b/marshall_test.go
@@ -15,13 +15,15 @@ func TestMarshallXML(t *testing.T) {
Time: 1479682785,
Album: Correctable{Name: "Mellow Gold"}},
}
- fmt.Printf("%v\n", s)
scrobbles := Scrobbles{Scrobbles: s,
Attrs: Attrs{1, 0}}
- output, err := xml.MarshalIndent(scrobbles, " ", " ")
+ response := LFMResponse{Status: "ok",
+ Response: scrobbles}
+ output, err := xml.MarshalIndent(response, " ", " ")
if err != nil {
fmt.Printf("error: %v\n", err)
}
+ fmt.Printf(xml.Header)
os.Stdout.Write(output)
}
@@ -34,8 +36,9 @@ func TestMarshallJSON(t *testing.T) {
}
scrobbles := Scrobbles{Scrobbles: s,
Attrs: Attrs{1, 0}}
- jsonscrobble := map[string]Scrobbles{"scrobbles": scrobbles}
- output, err := json.MarshalIndent(jsonscrobble, " ", " ")
+ response := LFMResponse{Status: "ok",
+ Response: scrobbles}
+ output, err := json.MarshalIndent(response, " ", " ")
if err != nil {
fmt.Printf("error: %v\n", err)
}