From 1d0df2d68aea1ad41a8d1b53d0cd186383ed15c1 Mon Sep 17 00:00:00 2001 From: Colin Arnott Date: Thu, 21 Mar 2019 08:34:21 +0000 Subject: [PATCH] add mod file and bump major version - continuation of module change from #52 - since your release tags are v2+ simply adding a go.mod file will cause `v2.0.0+incompatible` versions in consumers - the go authors suggest bumping the major version to resolve this: https://github.com/golang/go/wiki/Modules#incrementing-the-major-version-when-first-adopting-modules-with-v2-packages - after merge you should tag this repo with `v3.0.0` - you could migrate to `v2.1.0`, but this could cause consumer breakage - this uses the major branch paradigm, but you could leverage major subdirectory instead: https://github.com/golang/go/wiki/Modules#releasing-modules-v2-or-higher --- examples/advanced-transform/advanced-transform.go | 2 +- examples/content-addressable-store/cas.go | 2 +- examples/git-like-store/git-like-store.go | 2 +- examples/super-simple-store/super-simple-store.go | 2 +- go.mod | 5 +++++ go.sum | 2 ++ import_test.go | 2 +- 7 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 go.mod create mode 100644 go.sum diff --git a/examples/advanced-transform/advanced-transform.go b/examples/advanced-transform/advanced-transform.go index 911b526..883bcbc 100644 --- a/examples/advanced-transform/advanced-transform.go +++ b/examples/advanced-transform/advanced-transform.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "github.com/peterbourgon/diskv" + "github.com/peterbourgon/diskv/v3" ) func AdvancedTransformExample(key string) *diskv.PathKey { diff --git a/examples/content-addressable-store/cas.go b/examples/content-addressable-store/cas.go index a3abaaf..d286699 100644 --- a/examples/content-addressable-store/cas.go +++ b/examples/content-addressable-store/cas.go @@ -5,7 +5,7 @@ import ( "fmt" "io" - "github.com/peterbourgon/diskv" + "github.com/peterbourgon/diskv/v3" ) const transformBlockSize = 2 // grouping of chars per directory depth diff --git a/examples/git-like-store/git-like-store.go b/examples/git-like-store/git-like-store.go index 055297b..2fc9fe2 100644 --- a/examples/git-like-store/git-like-store.go +++ b/examples/git-like-store/git-like-store.go @@ -14,7 +14,7 @@ import ( "regexp" "strings" - "github.com/peterbourgon/diskv" + "github.com/peterbourgon/diskv/v3" ) var hex40 = regexp.MustCompile("[0-9a-fA-F]{40}") diff --git a/examples/super-simple-store/super-simple-store.go b/examples/super-simple-store/super-simple-store.go index 573d26a..4df3099 100644 --- a/examples/super-simple-store/super-simple-store.go +++ b/examples/super-simple-store/super-simple-store.go @@ -3,7 +3,7 @@ package main import ( "fmt" - "github.com/peterbourgon/diskv" + "github.com/peterbourgon/diskv/v3" ) func main() { diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..095d378 --- /dev/null +++ b/go.mod @@ -0,0 +1,5 @@ +module github.com/peterbourgon/diskv/v3 + +go 1.12 + +require github.com/google/btree v1.0.0 diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..cd0677c --- /dev/null +++ b/go.sum @@ -0,0 +1,2 @@ +github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= diff --git a/import_test.go b/import_test.go index a08ac7c..fccdf99 100644 --- a/import_test.go +++ b/import_test.go @@ -5,7 +5,7 @@ import ( "io/ioutil" "os" - "github.com/peterbourgon/diskv" + "github.com/peterbourgon/diskv/v3" "testing" )