mirror of
https://github.com/pikami/cosmium.git
synced 2025-12-20 01:10:44 +00:00
Shared library stability improvements
This commit is contained in:
@@ -3,6 +3,7 @@ package main
|
||||
import "C"
|
||||
import (
|
||||
"encoding/json"
|
||||
"strings"
|
||||
|
||||
repositorymodels "github.com/pikami/cosmium/internal/repository_models"
|
||||
)
|
||||
@@ -21,7 +22,7 @@ func CreateDocument(serverName *C.char, databaseId *C.char, collectionId *C.char
|
||||
}
|
||||
|
||||
var document repositorymodels.Document
|
||||
err := json.Unmarshal([]byte(documentStr), &document)
|
||||
err := json.NewDecoder(strings.NewReader(documentStr)).Decode(&document)
|
||||
if err != nil {
|
||||
return ResponseFailedToParseRequest
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user