Created
January 29, 2019 16:50
-
-
Save jlindsey/0f9f5d58a654f315a88c18d4a33ececd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.Update(func(tx *bolt.Tx) error { | |
var res error | |
buckets := [][]byte{ | |
[]byte("permissions"), | |
[]byte("history"), | |
[]byte("schedules"), | |
} | |
for _, name := range buckets { | |
if _, err := tx.CreateBucketIfNotExists(name); err != nil { | |
res = multierror.Append(res, err) | |
} | |
} | |
return res | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment