From 107dea6e7a205b89fb9b96d1d3924072c331998c Mon Sep 17 00:00:00 2001 From: Marc Date: Fri, 18 Feb 2022 16:07:03 +0000 Subject: [PATCH] Switch import path to hak5 fork --- Makefile | 2 +- README.md | 10 +++++----- bucket_test.go | 6 +++--- cmd/bolt/main.go | 4 ++-- cmd/bolt/main_test.go | 4 ++-- cursor.go | 4 ++-- cursor_test.go | 4 ++-- db.go | 4 ++-- db_test.go | 6 +++--- go.mod | 5 +++++ go.sum | 2 ++ node.go | 2 +- simulation_test.go | 2 +- tx_test.go | 2 +- 14 files changed, 32 insertions(+), 25 deletions(-) create mode 100644 go.mod create mode 100644 go.sum diff --git a/Makefile b/Makefile index e035e63..e482843 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ race: # go get github.com/kisielk/errcheck errcheck: - @errcheck -ignorepkg=bytes -ignore=os:Remove github.com/boltdb/bolt + @errcheck -ignorepkg=bytes -ignore=os:Remove github.com/hak5/bolt test: @go test -v -cover . diff --git a/README.md b/README.md index fc2a1e0..c6ec8af 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -Bolt [![Coverage Status](https://coveralls.io/repos/boltdb/bolt/badge.svg?branch=master)](https://coveralls.io/r/boltdb/bolt?branch=master) [![GoDoc](https://godoc.org/github.com/boltdb/bolt?status.svg)](https://godoc.org/github.com/boltdb/bolt) ![Version](https://img.shields.io/badge/version-1.2.1-green.svg) +Bolt [![Coverage Status](https://coveralls.io/repos/boltdb/bolt/badge.svg?branch=master)](https://coveralls.io/r/boltdb/bolt?branch=master) [![GoDoc](https://godoc.org/github.com/hak5/bolt?status.svg)](https://godoc.org/github.com/hak5/bolt) ![Version](https://img.shields.io/badge/version-1.2.1-green.svg) ==== Bolt is a pure Go key/value store inspired by [Howard Chu's][hyc_symas] @@ -78,7 +78,7 @@ Shopify and Heroku use Bolt-backed services every day. To start using Bolt, install Go and run `go get`: ```sh -$ go get github.com/boltdb/bolt/... +$ go get github.com/hak5/bolt/... ``` This will retrieve the library and install the `bolt` command line utility into @@ -98,7 +98,7 @@ package main import ( "log" - "github.com/boltdb/bolt" + "github.com/hak5/bolt" ) func main() { @@ -541,7 +541,7 @@ this from a read-only transaction, it will perform a hot backup and not block your other database reads and writes. By default, it will use a regular file handle which will utilize the operating -system's page cache. See the [`Tx`](https://godoc.org/github.com/boltdb/bolt#Tx) +system's page cache. See the [`Tx`](https://godoc.org/github.com/hak5/bolt#Tx) documentation for information about optimizing for larger-than-RAM datasets. One common use case is to backup over HTTP so you can use tools like `cURL` to @@ -825,7 +825,7 @@ Here are a few things to note when evaluating and using Bolt: For more information on page allocation, [see this comment][page-allocation]. -[page-allocation]: https://github.com/boltdb/bolt/issues/308#issuecomment-74811638 +[page-allocation]: https://github.com/hak5/bolt/issues/308#issuecomment-74811638 ## Reading the Source diff --git a/bucket_test.go b/bucket_test.go index cddbe27..e7abec9 100644 --- a/bucket_test.go +++ b/bucket_test.go @@ -13,7 +13,7 @@ import ( "testing" "testing/quick" - "github.com/boltdb/bolt" + "github.com/hak5/bolt" ) // Ensure that a bucket that gets a non-existent key returns nil. @@ -83,7 +83,7 @@ func TestBucket_Get_IncompatibleValue(t *testing.T) { // Ensure that a slice returned from a bucket has a capacity equal to its length. // This also allows slices to be appended to since it will require a realloc by Go. // -// https://github.com/boltdb/bolt/issues/544 +// https://github.com/hak5/bolt/issues/544 func TestBucket_Get_Capacity(t *testing.T) { db := MustOpenDB() defer db.MustClose() @@ -867,7 +867,7 @@ func TestBucket_NextSequence(t *testing.T) { // Ensure that a bucket will persist an autoincrementing sequence even if its // the only thing updated on the bucket. -// https://github.com/boltdb/bolt/issues/296 +// https://github.com/hak5/bolt/issues/296 func TestBucket_NextSequence_Persist(t *testing.T) { db := MustOpenDB() defer db.MustClose() diff --git a/cmd/bolt/main.go b/cmd/bolt/main.go index 057eca5..8cf7f48 100644 --- a/cmd/bolt/main.go +++ b/cmd/bolt/main.go @@ -19,7 +19,7 @@ import ( "unicode/utf8" "unsafe" - "github.com/boltdb/bolt" + "github.com/hak5/bolt" ) var ( @@ -875,7 +875,7 @@ The following errors can be reported: No errors should occur in your database. However, if for some reason you experience corruption, please submit a ticket to the Bolt project page: - https://github.com/boltdb/bolt/issues + https://github.com/hak5/bolt/issues `, "\n") } diff --git a/cmd/bolt/main_test.go b/cmd/bolt/main_test.go index 0a11ff3..08c0a1f 100644 --- a/cmd/bolt/main_test.go +++ b/cmd/bolt/main_test.go @@ -12,8 +12,8 @@ import ( "strconv" "testing" - "github.com/boltdb/bolt" - "github.com/boltdb/bolt/cmd/bolt" + "github.com/hak5/bolt" + "github.com/hak5/bolt/cmd/bolt" ) // Ensure the "info" command can print information about a database. diff --git a/cursor.go b/cursor.go index 1be9f35..39fc849 100644 --- a/cursor.go +++ b/cursor.go @@ -36,7 +36,7 @@ func (c *Cursor) First() (key []byte, value []byte) { c.first() // If we land on an empty page then move to the next value. - // https://github.com/boltdb/bolt/issues/450 + // https://github.com/hak5/bolt/issues/450 if c.stack[len(c.stack)-1].count() == 0 { c.next() } @@ -240,7 +240,7 @@ func (c *Cursor) next() (key []byte, value []byte, flags uint32) { c.first() // If this is an empty page then restart and move back up the stack. - // https://github.com/boltdb/bolt/issues/450 + // https://github.com/hak5/bolt/issues/450 if c.stack[len(c.stack)-1].count() == 0 { continue } diff --git a/cursor_test.go b/cursor_test.go index 562d60f..3532d6d 100644 --- a/cursor_test.go +++ b/cursor_test.go @@ -11,7 +11,7 @@ import ( "testing" "testing/quick" - "github.com/boltdb/bolt" + "github.com/hak5/bolt" ) // Ensure that a cursor can return a reference to the bucket that created it. @@ -165,7 +165,7 @@ func TestCursor_Delete(t *testing.T) { // large number of keys. This test also checks that seek will always move // forward to the next key. // -// Related: https://github.com/boltdb/bolt/pull/187 +// Related: https://github.com/hak5/bolt/pull/187 func TestCursor_Seek_Large(t *testing.T) { db := MustOpenDB() defer db.MustClose() diff --git a/db.go b/db.go index cc3596f..fe644c5 100644 --- a/db.go +++ b/db.go @@ -66,7 +66,7 @@ type DB struct { // Skipping truncation avoids preallocation of hard drive space and // bypasses a truncate() and fsync() syscall on remapping. // - // https://github.com/boltdb/bolt/issues/284 + // https://github.com/hak5/bolt/issues/284 NoGrowSync bool // If you want to read the entire database fast, you can set MmapFlag to @@ -871,7 +871,7 @@ func (db *DB) grow(sz int) error { } // Truncate and fsync to ensure file size metadata is flushed. - // https://github.com/boltdb/bolt/issues/284 + // https://github.com/hak5/bolt/issues/284 if !db.NoGrowSync && !db.readOnly { if runtime.GOOS != "windows" { if err := db.file.Truncate(int64(sz)); err != nil { diff --git a/db_test.go b/db_test.go index 3034d4f..e926ef7 100644 --- a/db_test.go +++ b/db_test.go @@ -19,7 +19,7 @@ import ( "time" "unsafe" - "github.com/boltdb/bolt" + "github.com/hak5/bolt" ) var statsFlag = flag.Bool("stats", false, "show performance stats") @@ -180,7 +180,7 @@ func TestOpen_ErrChecksum(t *testing.T) { } // Ensure that opening a database does not increase its size. -// https://github.com/boltdb/bolt/issues/291 +// https://github.com/hak5/bolt/issues/291 func TestOpen_Size(t *testing.T) { // Open a data file. db := MustOpenDB() @@ -240,7 +240,7 @@ func TestOpen_Size(t *testing.T) { } // Ensure that opening a database beyond the max step size does not increase its size. -// https://github.com/boltdb/bolt/issues/303 +// https://github.com/hak5/bolt/issues/303 func TestOpen_Size_Large(t *testing.T) { if testing.Short() { t.Skip("short mode") diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..c49574d --- /dev/null +++ b/go.mod @@ -0,0 +1,5 @@ +module github.com/hak5/bolt + +go 1.17 + +require golang.org/x/sys v0.0.0-20220209214540-3681064d5158 diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..8fc3f79 --- /dev/null +++ b/go.sum @@ -0,0 +1,2 @@ +golang.org/x/sys v0.0.0-20220209214540-3681064d5158 h1:rm+CHSpPEEW2IsXUib1ThaHIjuBVZjxNgSKmBLFfD4c= +golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/node.go b/node.go index 159318b..e9f383a 100644 --- a/node.go +++ b/node.go @@ -229,7 +229,7 @@ func (n *node) write(p *page) { // If the length of key+value is larger than the max allocation size // then we need to reallocate the byte array pointer. // - // See: https://github.com/boltdb/bolt/pull/335 + // See: https://github.com/hak5/bolt/pull/335 klen, vlen := len(item.key), len(item.value) if len(b) < klen+vlen { b = (*[maxAllocSize]byte)(unsafe.Pointer(&b[0]))[:] diff --git a/simulation_test.go b/simulation_test.go index 3831016..88d05a0 100644 --- a/simulation_test.go +++ b/simulation_test.go @@ -7,7 +7,7 @@ import ( "sync" "testing" - "github.com/boltdb/bolt" + "github.com/hak5/bolt" ) func TestSimulate_1op_1p(t *testing.T) { testSimulate(t, 1, 1) } diff --git a/tx_test.go b/tx_test.go index 2201e79..81ccaea 100644 --- a/tx_test.go +++ b/tx_test.go @@ -8,7 +8,7 @@ import ( "os" "testing" - "github.com/boltdb/bolt" + "github.com/hak5/bolt" ) // Ensure that committing a closed transaction returns an error.