From 891bf429ad4fb96ec53b94284efdba17b262c600 Mon Sep 17 00:00:00 2001 From: Stanislas Michalak Date: Wed, 13 Feb 2019 20:55:51 +0100 Subject: [PATCH] Migrate gobuffalo/uuid to gofrs/uuid (#348) --- SHOULDERS.md | 8 ++------ associations/belongs_to_association_test.go | 2 +- associations/has_one_association_test.go | 2 +- associations/many_to_many_association.go | 2 +- associations/many_to_many_association_test.go | 8 ++++---- dialect.go | 2 +- executors.go | 2 +- executors_test.go | 2 +- finders.go | 2 +- finders_test.go | 2 +- genny/config/config-packr.go | 1 + model.go | 2 +- nulls/nulls.go | 2 +- nulls/types_test.go | 2 +- nulls/uuid.go | 2 +- nulls/uuid_test.go | 2 +- packrd/packed-packr.go | 19 ++++++++++--------- pop_test.go | 2 +- query_test.go | 2 +- slices/uuid.go | 2 +- slices/uuid_test.go | 2 +- soda/cmd/generate/attribute.go | 2 +- soda/cmd/generate/model.go | 2 +- 23 files changed, 36 insertions(+), 38 deletions(-) diff --git a/SHOULDERS.md b/SHOULDERS.md index dd583011..7ace7345 100644 --- a/SHOULDERS.md +++ b/SHOULDERS.md @@ -1,6 +1,6 @@ -# github.com/gobuffalo/pop Stands on the Shoulders of Giants +# Pop Stands on the Shoulders of Giants -github.com/gobuffalo/pop does not try to reinvent the wheel! Instead, it uses the already great wheels developed by the Go community and puts them all together in the best way possible. Without these giants this project would not be possible. Please make sure to check them out and thank them for all of their hard work. +Pop does not try to reinvent the wheel! Instead, it uses the already great wheels developed by the Go community and puts them all together in the best way possible. Without these giants, this project would not be possible. Please make sure to check them out and thank them for all of their hard work. Thank you to the following **GIANTS**: @@ -113,10 +113,6 @@ Thank you to the following **GIANTS**: * [github.com/markbates/oncer](https://godoc.org/github.com/markbates/oncer) -* [github.com/mattn/go-colorable](https://godoc.org/github.com/mattn/go-colorable) - -* [github.com/mattn/go-isatty](https://godoc.org/github.com/mattn/go-isatty) - * [github.com/microcosm-cc/bluemonday](https://godoc.org/github.com/microcosm-cc/bluemonday) * [github.com/pkg/errors](https://godoc.org/github.com/pkg/errors) diff --git a/associations/belongs_to_association_test.go b/associations/belongs_to_association_test.go index c81a0b3c..d1e51f83 100644 --- a/associations/belongs_to_association_test.go +++ b/associations/belongs_to_association_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/gobuffalo/pop/associations" - "github.com/gobuffalo/uuid" + "github.com/gofrs/uuid" "github.com/stretchr/testify/require" ) diff --git a/associations/has_one_association_test.go b/associations/has_one_association_test.go index 10f6ef89..06a3ed72 100644 --- a/associations/has_one_association_test.go +++ b/associations/has_one_association_test.go @@ -6,7 +6,7 @@ import ( "github.com/gobuffalo/pop/associations" "github.com/gobuffalo/pop/nulls" - "github.com/gobuffalo/uuid" + "github.com/gofrs/uuid" "github.com/stretchr/testify/require" ) diff --git a/associations/many_to_many_association.go b/associations/many_to_many_association.go index a2cb7fc4..3bbc86d4 100644 --- a/associations/many_to_many_association.go +++ b/associations/many_to_many_association.go @@ -6,7 +6,7 @@ import ( "time" "github.com/gobuffalo/flect" - "github.com/gobuffalo/uuid" + "github.com/gofrs/uuid" ) type manyToManyAssociation struct { diff --git a/associations/many_to_many_association_test.go b/associations/many_to_many_association_test.go index 840041c3..360e4161 100644 --- a/associations/many_to_many_association_test.go +++ b/associations/many_to_many_association_test.go @@ -5,13 +5,13 @@ import ( "testing" "github.com/gobuffalo/pop/associations" - "github.com/gobuffalo/uuid" + "github.com/gofrs/uuid" "github.com/stretchr/testify/require" ) type fooManyToMany struct { - ID uuid.UUID `db:"id"` - BarManyToManies barManyToManies `many_to_many:"foos_and_bars"` + ID uuid.UUID `db:"id"` + BarManyToManies barManyToManies `many_to_many:"foos_and_bars"` } type fooManyToMany2 struct { @@ -63,4 +63,4 @@ func Test_Many_To_Many_PrimaryId_Tag(t *testing.T) { where, args := as[0].Constraint() a.Equal("id in (select bar_many_to_many_id from foos_and_bars where fufu_id = ?)", where) a.Equal(id, args[0].(uuid.UUID)) -} \ No newline at end of file +} diff --git a/dialect.go b/dialect.go index 11b961d1..645d6cc3 100644 --- a/dialect.go +++ b/dialect.go @@ -13,7 +13,7 @@ import ( "github.com/gobuffalo/fizz" "github.com/gobuffalo/pop/columns" "github.com/gobuffalo/pop/logging" - "github.com/gobuffalo/uuid" + "github.com/gofrs/uuid" "github.com/jmoiron/sqlx" "github.com/pkg/errors" ) diff --git a/executors.go b/executors.go index c45e9d13..afd9f1a6 100644 --- a/executors.go +++ b/executors.go @@ -6,8 +6,8 @@ import ( "github.com/gobuffalo/pop/associations" "github.com/gobuffalo/pop/columns" "github.com/gobuffalo/pop/logging" - "github.com/gobuffalo/uuid" "github.com/gobuffalo/validate" + "github.com/gofrs/uuid" ) // Reload fetch fresh data for a given model, using its ID. diff --git a/executors_test.go b/executors_test.go index 90678d1e..29635e3a 100644 --- a/executors_test.go +++ b/executors_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/gobuffalo/pop/nulls" - "github.com/gobuffalo/uuid" + "github.com/gofrs/uuid" "github.com/stretchr/testify/require" ) diff --git a/finders.go b/finders.go index 633d50c7..026ec1b7 100644 --- a/finders.go +++ b/finders.go @@ -10,7 +10,7 @@ import ( "github.com/gobuffalo/pop/associations" "github.com/gobuffalo/pop/logging" - "github.com/gobuffalo/uuid" + "github.com/gofrs/uuid" "github.com/pkg/errors" ) diff --git a/finders_test.go b/finders_test.go index 35a6da21..d330a07a 100644 --- a/finders_test.go +++ b/finders_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/gobuffalo/pop/nulls" - "github.com/gobuffalo/uuid" + "github.com/gofrs/uuid" "github.com/stretchr/testify/require" ) diff --git a/genny/config/config-packr.go b/genny/config/config-packr.go index 9da88ac5..9d14c82e 100644 --- a/genny/config/config-packr.go +++ b/genny/config/config-packr.go @@ -1,3 +1,4 @@ +// +build !skippackr // Code generated by github.com/gobuffalo/packr/v2. DO NOT EDIT. // You can use the "packr clean" command to clean up this, diff --git a/model.go b/model.go index 7f1893b9..67b61175 100644 --- a/model.go +++ b/model.go @@ -8,7 +8,7 @@ import ( "github.com/gobuffalo/flect" nflect "github.com/gobuffalo/flect/name" - "github.com/gobuffalo/uuid" + "github.com/gofrs/uuid" "github.com/pkg/errors" ) diff --git a/nulls/nulls.go b/nulls/nulls.go index 4f547cb8..bb1cd44b 100644 --- a/nulls/nulls.go +++ b/nulls/nulls.go @@ -3,7 +3,7 @@ package nulls import ( "database/sql/driver" - "github.com/gobuffalo/uuid" + "github.com/gofrs/uuid" ) // nullable a generic representation of nulls type. diff --git a/nulls/types_test.go b/nulls/types_test.go index b09f39fa..61791153 100644 --- a/nulls/types_test.go +++ b/nulls/types_test.go @@ -10,7 +10,7 @@ import ( "time" . "github.com/gobuffalo/pop/nulls" - "github.com/gobuffalo/uuid" + "github.com/gofrs/uuid" "github.com/jmoiron/sqlx" _ "github.com/mattn/go-sqlite3" "github.com/stretchr/testify/require" diff --git a/nulls/uuid.go b/nulls/uuid.go index 6a5fcbfc..609f3c9d 100644 --- a/nulls/uuid.go +++ b/nulls/uuid.go @@ -5,7 +5,7 @@ import ( "encoding/json" "strings" - "github.com/gobuffalo/uuid" + "github.com/gofrs/uuid" "github.com/pkg/errors" ) diff --git a/nulls/uuid_test.go b/nulls/uuid_test.go index 4dc2a48f..a85877d6 100644 --- a/nulls/uuid_test.go +++ b/nulls/uuid_test.go @@ -4,7 +4,7 @@ import ( "encoding/json" "testing" - "github.com/gobuffalo/uuid" + "github.com/gofrs/uuid" "github.com/stretchr/testify/require" ) diff --git a/packrd/packed-packr.go b/packrd/packed-packr.go index 2275420d..1df43fae 100644 --- a/packrd/packed-packr.go +++ b/packrd/packed-packr.go @@ -1,3 +1,4 @@ +// +build !skippackr // Code generated by github.com/gobuffalo/packr/v2. DO NOT EDIT. // You can use the "packr2 clean" command to clean up this, @@ -10,13 +11,13 @@ import ( ) var _ = func() error { - const gk = "78aa01be528be8fc333fc794bc4a3c1b" + const gk = "4e654205d93cebc578e9551b62c531a0" g := packr.New(gk, "") hgr, err := resolver.NewHexGzip(map[string]string{ - "4526cfd1d77bab7843d30700c2868275": "1f8b08000000000000ffac94516bdb400cc7dffb29340f460b251d648c61285bb61656284d4952c69ee28bad24c7ce2757a74b1742befb909d3849b70c56f69060cb27e92ffda42b70818eaa12bda4270085350e7349212997e1d1256a32622626600ac96ad5a14a42e79e716a7faed7e33d6f3d3aa7a0ae8e72e3f4596d15b1dabaddb7eff53506e41412266abe9a109e888bd67422188e2979ad3ff84e1172e335121808d6cf1cc2c3e01682b0f533981283cc1182291172f2533b8b6cc4924fb73122bb6ddcf4e24213a7faf7e9b4559eaadeb38bdf0a56751f2bc30147b6c44be1886fcae8c40ec5086a1f42636434851ea12897ddb0537f478220732360a7b0a45897914576d93990cc910f2507308c10ac432f6e0976e689b1e8d4a16e3cc8dc06c84dc0f3ba64ed421983680c31d683710e181fa3652cd4e831d7a8501936250a72e86c94fd8db216fdbff0564c45cc0f68b4448d0b54f703fdc232796da771b0306ccdc4610021a00532db0261615cc40076db84ba6b9d03c2ab55b25a25eb35fa459f21b9ea8d7a9f7bc3ebf1c3e0367919fe9dfa970cc17abd6df6bf6dd92eeb8ec2b1dabef687a3649f519db4a174cce7be3f509f9a617dbca178b47dc3eb41b201da446f291fcdd01b0ebff50757076e0dfc9e2fea3d6807a025fcc77985c912028ae8a65b81e80b64a0aade9596fee6bd9e3095b721958252698ccf78ed7fdaa39642373446f43915d6cf5248a24c3f949377e3197a64e3c6b9ddadf797dec3e8a67ff7aa7182accd9d81f145f63c6dd6aceb04b5261def4c6564faf444fc032aa60ad92d3b9b7837cd9da1778227811019cfa1a0fa259f1b3f433825d660677a2184ed9a744e7e050000ffff79f0e5cfe8050000", - "53687fd7c4aa5237e9bf81249c4bd931": "1f8b08000000000000ffecd1416b32311006e0fbfe8a21df7d51c14fd89b6c05c1426463293d494ca6b8189d25136dcb92ff5e62517b28dbe24df03ae4c99bc96bf1808e9a2dee429101d85a3b34a1004366e3499b751aeaa0579ab180b6cda9099ccf3dbed6ef312ebff10c604d1cd221d1b62246c0dd417a10a52c67951c97d3e554aa8500d11f8cf25edecbfb0220c60ca021dfe9e6b24a6ef07f301c9dcc9ed177992735a904084f14ce319af98dbced8c1a2bf52cab0701e2f23a72050c33006a424d3b4e1f05c0ecb664b1005bb35e393c0eff31bb1469b07b23a51e9795948b7272dcec14f575c15ff08f70831fbfb9d9e4e5ccb2807c55ebc9ddebbeb9ba1b4f766fd24ed7947ed1f7ea6fadfacf000000ffff1757d2dbe6050000", - "793e1955dae01f2888949d22a97bc7af": "1f8b08000000000000ffac8ec14a03311086ef798a210f906dab450888aed89ba0d8f5bca4cda80be94ec8cc5621e4dd2542ab45bd79fbf9997fbecfe31e03c51d8e6215801f5cc0ad5888c4f292906be7c46d1ca3859c0d4561f390f079782fa5ffb6560013633a5946c7fc46c99f94afc46261beb830333333f37a46142c2c9512e44f8b29850ad339eb5270dcdf27d0dd6addf5b76dd7deb4eb55fff478a7411fbedaa639c643b83e12ecf2fc6cd1fc70afb02be6b0238f977e60b709a84b512a26f2d356061aff72f94f8d2fda6f321f010000ffffb44a8cd79f010000", - "d6126d474cf9b7af331e89fba0c6f146": "1f8b08000000000000ff4a492d4bcdc92fc84dcd2bb1e2525048c94ccc494d2eb152502a2eccc92c4935560209269624262516a75a295457ebe5179414eb05e5e797d4d6c6c3b80145a9699915b5b5f148a6e9410ce0e22a492da686d12063e0661614e5a794269764e6e751c164846130f301010000ffffd5f1ef6a15010000", + "0a8099bb4a4043c45f688577c1b0a873": "1f8b08000000000000ffac8ec14a03311086ef798a210f906dab450888aed89ba0d8f5bca4cda80be94ec8cc5621e4dd2542ab45bd79fbf9997fbecfe31e03c51d8e6215801f5cc0ad5888c4f292906be7c46d1ca3859c0d4561f390f079782fa5ffb6560013633a5946c7fc46c99f94afc46261beb830333333f37a46142c2c9512e44f8b29850ad339eb5270dcdf27d0dd6addf5b76dd7deb4eb55fff478a7411fbedaa639c643b83e12ecf2fc6cd1fc70afb02be6b0238f977e60b709a84b512a26f2d356061aff72f94f8d2fda6f321f010000ffffb44a8cd79f010000", + "8f5e9ed39d46e566076b611748574060": "1f8b08000000000000ffac94516bdb400cc7dffb29340f460b251d648c61285bb61656284d4952c69ee28bad24c7ce2757a74b1742befb909d3849b70c56f69060cb27e92ffda42b70818eaa12bda4270085350e7349212997e1d1256a32622626600ac96ad5a14a42e79e716a7faed7e33d6f3d3aa7a0ae8e72e3f4596d15b1dabaddb7eff53506e41412266abe9a109e888bd67422188e2979ad3ff84e1172e335121808d6cf1cc2c3e01682b0f533981283cc1182291172f2533b8b6cc4924fb73122bb6ddcf4e24213a7faf7e9b4559eaadeb38bdf0a56751f2bc30147b6c44be1886fcae8c40ec5086a1f42636434851ea12897ddb0537f478220732360a7b0a45897914576d93990cc910f2507308c10ac432f6e0976e689b1e8d4a16e3cc8dc06c84dc0f3ba64ed421983680c31d683710e181fa3652cd4e831d7a8501936250a72e86c94fd8db216fdbff0564c45cc0f68b4448d0b54f703fdc232796da771b0306ccdc4610021a00532db0261615cc40076db84ba6b9d03c2ab55b25a25eb35fa459f21b9ea8d7a9f7bc3ebf1c3e0367919fe9dfa970cc17abd6df6bf6dd92eeb8ec2b1dabef687a3649f519db4a174cce7be3f509f9a617dbca178b47dc3eb41b201da446f291fcdd01b0ebff50757076e0dfc9e2fea3d6807a025fcc77985c912028ae8a65b81e80b64a0aade9596fee6bd9e3095b721958252698ccf78ed7fdaa39642373446f43915d6cf5248a24c3f949377e3197a64e3c6b9ddadf797dec3e8a67ff7aa7182accd9d81f145f63c6dd6aceb04b5261def4c6564faf444fc032aa60ad92d3b9b7837cd9da1778227811019cfa1a0fa259f1b3f433825d660677a2184ed9a744e7e050000ffff79f0e5cfe8050000", + "916cbe5c15df18971eb206231dea86b2": "1f8b08000000000000ff4a492d4bcdc92fc84dcd2bb1e2525048c94ccc494d2eb152502a2eccc92c4935560209269624262516a75a295457ebe5179414eb05e5e797d4d6c6c3b80145a9699915b5b5f148a6e9410ce0e22a492da686d12063e0661614e5a794269764e6e751c164846130f301010000ffffd5f1ef6a15010000", + "a7a361aec2e57802a9f959cd4b120775": "1f8b08000000000000ffecd1416b32311006e0fbfe8a21df7d51c14fd89b6c05c1426463293d494ca6b8189d25136dcb92ff5e62517b28dbe24df03ae4c99bc96bf1808e9a2dee429101d85a3b34a1004366e3499b751aeaa0579ab180b6cda9099ccf3dbed6ef312ebff10c604d1cd221d1b62246c0dd417a10a52c67951c97d3e554aa8500d11f8cf25edecbfb0220c60ca021dfe9e6b24a6ef07f301c9dcc9ed177992735a904084f14ce319af98dbced8c1a2bf52cab0701e2f23a72050c33006a424d3b4e1f05c0ecb664b1005bb35e393c0eff31bb1469b07b23a51e9795948b7272dcec14f575c15ff08f70831fbfb9d9e4e5ccb2807c55ebc9ddebbeb9ba1b4f766fd24ed7947ed1f7ea6fadfacf000000ffff1757d2dbe6050000", }) if err != nil { panic(err) @@ -25,10 +26,10 @@ var _ = func() error { func() { b := packr.New("pop:genny:config", "../config/templates") - b.SetResolver("cockroach.yml.tmpl", packr.Pointer{ForwardBox: gk, ForwardPath: "53687fd7c4aa5237e9bf81249c4bd931"}) - b.SetResolver("mysql.yml.tmpl", packr.Pointer{ForwardBox: gk, ForwardPath: "4526cfd1d77bab7843d30700c2868275"}) - b.SetResolver("postgres.yml.tmpl", packr.Pointer{ForwardBox: gk, ForwardPath: "793e1955dae01f2888949d22a97bc7af"}) - b.SetResolver("sqlite3.yml.tmpl", packr.Pointer{ForwardBox: gk, ForwardPath: "d6126d474cf9b7af331e89fba0c6f146"}) + b.SetResolver("cockroach.yml.tmpl", packr.Pointer{ForwardBox: gk, ForwardPath: "a7a361aec2e57802a9f959cd4b120775"}) + b.SetResolver("mysql.yml.tmpl", packr.Pointer{ForwardBox: gk, ForwardPath: "8f5e9ed39d46e566076b611748574060"}) + b.SetResolver("postgres.yml.tmpl", packr.Pointer{ForwardBox: gk, ForwardPath: "0a8099bb4a4043c45f688577c1b0a873"}) + b.SetResolver("sqlite3.yml.tmpl", packr.Pointer{ForwardBox: gk, ForwardPath: "916cbe5c15df18971eb206231dea86b2"}) }() return nil diff --git a/pop_test.go b/pop_test.go index 67978ed3..f86424e9 100644 --- a/pop_test.go +++ b/pop_test.go @@ -8,9 +8,9 @@ import ( "github.com/gobuffalo/pop/logging" "github.com/gobuffalo/pop/nulls" - "github.com/gobuffalo/uuid" "github.com/gobuffalo/validate" "github.com/gobuffalo/validate/validators" + "github.com/gofrs/uuid" "github.com/stretchr/testify/suite" ) diff --git a/query_test.go b/query_test.go index d28f8650..d61445fb 100644 --- a/query_test.go +++ b/query_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/gobuffalo/uuid" + "github.com/gofrs/uuid" "github.com/stretchr/testify/require" ) diff --git a/slices/uuid.go b/slices/uuid.go index 7bdb8816..1657a37f 100644 --- a/slices/uuid.go +++ b/slices/uuid.go @@ -6,7 +6,7 @@ import ( "fmt" "strings" - "github.com/gobuffalo/uuid" + "github.com/gofrs/uuid" "github.com/pkg/errors" ) diff --git a/slices/uuid_test.go b/slices/uuid_test.go index 4e9deabc..0b34dc2f 100644 --- a/slices/uuid_test.go +++ b/slices/uuid_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/gobuffalo/uuid" + "github.com/gofrs/uuid" "github.com/stretchr/testify/require" ) diff --git a/soda/cmd/generate/attribute.go b/soda/cmd/generate/attribute.go index 044b9068..c3dcee49 100644 --- a/soda/cmd/generate/attribute.go +++ b/soda/cmd/generate/attribute.go @@ -50,7 +50,7 @@ func newAttribute(base string, model *model) (attribute, error) { model.Imports = append(model.Imports, "github.com/gobuffalo/pop/slices") } else if !model.HasUUID && col[1] == "uuid" { model.HasUUID = true - model.Imports = append(model.Imports, "github.com/gobuffalo/uuid") + model.Imports = append(model.Imports, "github.com/gofrs/uuid") } got := colType(col[1]) diff --git a/soda/cmd/generate/model.go b/soda/cmd/generate/model.go index 56f2a2fb..9faf62d6 100644 --- a/soda/cmd/generate/model.go +++ b/soda/cmd/generate/model.go @@ -144,7 +144,7 @@ func (m *model) addID() { if !m.HasUUID { m.HasUUID = true - m.Imports = append(m.Imports, "github.com/gobuffalo/uuid") + m.Imports = append(m.Imports, "github.com/gofrs/uuid") } id := flect.New("id")