BoltDB Lookup and Add methods and advice on unit testing
I think the code could benefit a struct for the database instead of global state.
You can use a New method instead of init() where you pass in the params, which would differet from test and production.
I also demonstrated that you can keep the connection open and reuse it within the struct. If you prefer a lazy approach, you can omit this and create a the connection in each call if you want.
type Database struct {
   bucketName string 
   boltDB *bolt.DB
}

func New(dbName, bucketName string, opts *bolt.Options) (db *Database, error) {
   db, err := bolt.Open(dbName, 0600, opts)
   return &amp;Database{
      boltDb: db,
      bucketName: bucketName
   }, nil
}

func(db *Database) Lookup(path string) (url string, ok bool) { // lookup logic }
func(db *Database) RegisterUrl(path, url string) error { //register logic}
```