Create a BoltItem interface and pass that into database items #1

Closed
dananglin wants to merge 15 commits from refactor/id-interface into main
4 changed files with 7 additions and 6 deletions
Showing only changes of commit 7d97ed4834 - Show all commits

2
db.go
View file

@ -205,7 +205,7 @@ func loadCard(db *bolt.DB, id int) (Card, error) {
var card Card var card Card
bucket := []byte(cardBucket) bucket := []byte(cardBucket)
err := db.View(func(tx *bolt.Tx)error { err := db.View(func(tx *bolt.Tx) error {
b := tx.Bucket(bucket) b := tx.Bucket(bucket)
if b == nil { if b == nil {

View file

@ -64,7 +64,7 @@ func TestDbDefaultPath(t *testing.T) {
if got != want { if got != want {
t.Errorf("Got unexpected database path: want %s, got %s", want, got) t.Errorf("Got unexpected database path: want %s, got %s", want, got)
} else { } else {
t.Logf("Got expected database path: got %s", got) t.Logf("Got expected database path: got %s", got)
} }
} }

View file

@ -9,7 +9,7 @@ type Status struct {
// Card represents a card on a Kanban board // Card represents a card on a Kanban board
type Card struct { type Card struct {
Id int Id int
Title string Title string
Content string Content string
} }

View file

@ -1,4 +1,5 @@
//+build mage //go:build mage
// +build mage
package main package main