Commit 44222d43 authored by David Venhoek's avatar David Venhoek
Browse files

Changed two json encoding errors that should never occur to panics.

parent 7fe5b20f
...@@ -110,8 +110,8 @@ func GetSessionResult(token *C.char) *C.char { ...@@ -110,8 +110,8 @@ func GetSessionResult(token *C.char) *C.char {
} }
resultJson, err := json.Marshal(result) resultJson, err := json.Marshal(result)
if err != nil { if err != nil {
// encoding error // encoding error, should never occur
return C.CString(err.Error()) panic(err)
} }
return C.CString(string(resultJson)) return C.CString(string(resultJson))
} }
...@@ -132,8 +132,8 @@ func GetRequest(token *C.char) *C.char { ...@@ -132,8 +132,8 @@ func GetRequest(token *C.char) *C.char {
} }
resultJson, err := json.Marshal(result) resultJson, err := json.Marshal(result)
if err != nil { if err != nil {
// encoding error // encoding error, should never occur
return C.CString(err.Error()) panic(err)
} }
return C.CString(string(resultJson)) return C.CString(string(resultJson))
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment