Distinguish between ReadJSON vs ReadJSONPtr. The latter expects a non-nil pointer to write into. The former creates new things intelligently

This commit is contained in:
Jae Kwon
2015-07-11 16:32:46 -07:00
parent 4504e6a9f4
commit 24acda1afc
4 changed files with 33 additions and 5 deletions
+1 -1
View File
@@ -58,7 +58,7 @@ type GenesisDoc struct {
func GenesisDocFromJSON(jsonBlob []byte) (genState *GenesisDoc) {
var err error
binary.ReadJSON(&genState, jsonBlob, &err)
binary.ReadJSONPtr(&genState, jsonBlob, &err)
if err != nil {
log.Error(Fmt("Couldn't read GenesisDoc: %v", err))
os.Exit(1)