async www read write

This commit is contained in:
gauthiier
2019-01-04 09:59:01 +01:00
parent ce232ce805
commit 6009696cb6
7 changed files with 193 additions and 57 deletions
+6 -6
View File
@@ -63,12 +63,12 @@ func MakeRandom(name string, max int) (*Playlist, error) {
return p, nil;
}
func (p *Playlist) Encode() string {
pp := p.Pretty()
res, _ := json.Marshal(pp)
return string(res)
func (mp *MinimalPlaylist) Encode() []byte {
res, err := json.Marshal(mp)
if err != nil {
return nil
}
return res
}
func Decode(jsonstr string) (*Playlist, error) {