merge with master

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
This commit is contained in:
Henrique Dias committed 2019-01-06 13:20:17 +00:00
commit 2b8bd28158
25 files changed
+233 -386

No files matched your search

+9
View File
@@ -1,6 +1,7 @@
package cmd
import (
"crypto/rand"
"errors"
"os"
@@ -80,3 +81,11 @@ func getDB() *storm.DB {
func getStorage(db *storm.DB) *storage.Storage {
return bolt.NewStorage(db)
}
func generateRandomBytes(n int) []byte {
b := make([]byte, n)
_, err := rand.Read(b)
checkErr(err)
// Note that err == nil only if we read len(b) bytes.
return b
}