Fix JSON unmarshal
parent
9aab54619a
commit
6fc525ce5e
4
entry.go
4
entry.go
|
@ -3,9 +3,9 @@ package main
|
|||
import (
|
||||
"bufio"
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"gopkg.in/yaml.v2"
|
||||
"io/ioutil"
|
||||
"math/rand"
|
||||
"net/http"
|
||||
|
@ -55,7 +55,7 @@ func CreateEntry(contentType ContentType, r *http.Request) (*Entry, error) {
|
|||
return nil, err
|
||||
}
|
||||
parsedMfItem := &MicroformatItem{}
|
||||
err = yaml.Unmarshal([]byte(bodyString), &parsedMfItem)
|
||||
err = json.Unmarshal([]byte(bodyString), &parsedMfItem)
|
||||
if err != nil {
|
||||
return nil, errors.New("failed to parse Json")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue