whoisjeremylam / enu

Enu API server application
0 stars 0 forks source link

row.Scan() in database.go needs to be passed []byte rather than String #50

Closed whoisjeremylam closed 9 years ago

whoisjeremylam commented 9 years ago

ie This will cause an error because errorMessage can be nil and the Scan() function doesn't handle nils properly.

var errorMessage string

row.Scan(&blockchainId, &addressToActivate, &amount, &rowId, &sourceAddress, &outAsset, &outAmount, &status, &broadcastTxId, &errorMessage); err == sql.ErrNoRows 

return errorMessage

Should be

var errorMessage []byte

row.Scan(&blockchainId, &addressToActivate, &amount, &rowId, &sourceAddress, &outAsset, &outAmount, &status, &broadcastTxId, &errorMessage); err == sql.ErrNoRows 

return string(errorMessage)