Skip to content

Instantly share code, notes, and snippets.

@jlindsey
Created January 29, 2019 16:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jlindsey/0f9f5d58a654f315a88c18d4a33ececd to your computer and use it in GitHub Desktop.
Save jlindsey/0f9f5d58a654f315a88c18d4a33ececd to your computer and use it in GitHub Desktop.
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