From 05102f323684fd852cb52d01328ae1ce63888ccb Mon Sep 17 00:00:00 2001 From: Mark Bates Date: Fri, 14 Jun 2019 13:49:34 -0500 Subject: [PATCH] moves a few dependencies internally to cut down on the number or external (#399) deps --- associations/associations_for_struct.go | 2 +- associations/belongs_to_association.go | 2 +- associations/has_one_association.go | 2 +- associations/many_to_many_association.go | 2 +- columns/columns_for_struct.go | 2 +- connection.go | 4 +- connection_details.go | 4 +- dialect_cockroach.go | 2 +- dialect_mysql.go | 4 +- dialect_postgresql.go | 2 +- dialect_sqlite.go | 2 +- internal/defaults/defaults.go | 36 ++++++++++++++++ internal/defaults/defaults_test.go | 52 ++++++++++++++++++++++++ internal/oncer/deprecate.go | 20 +++++++++ internal/oncer/oncer.go | 26 ++++++++++++ internal/randx/randx.go | 10 +++++ internal/randx/string.go | 35 ++++++++++++++++ internal/randx/string_test.go | 18 ++++++++ logger.go | 2 +- migration.go | 2 +- packrd/packed-packr.go | 27 +++++++----- paginator.go | 2 +- query_joins.go | 2 +- soda/cmd/generate/config_cmd.go | 4 +- soda/cmd/generate/fizz_cmd.go | 2 +- soda/cmd/generate/model.go | 2 +- soda/cmd/generate/sql_cmd.go | 2 +- soda/cmd/migrate_reset.go | 2 +- soda/cmd/root.go | 2 +- 29 files changed, 239 insertions(+), 35 deletions(-) create mode 100644 internal/defaults/defaults.go create mode 100644 internal/defaults/defaults_test.go create mode 100644 internal/oncer/deprecate.go create mode 100644 internal/oncer/oncer.go create mode 100644 internal/randx/randx.go create mode 100644 internal/randx/string.go create mode 100644 internal/randx/string_test.go diff --git a/associations/associations_for_struct.go b/associations/associations_for_struct.go index bf56aa14..552f158c 100644 --- a/associations/associations_for_struct.go +++ b/associations/associations_for_struct.go @@ -8,7 +8,7 @@ import ( "strings" "github.com/gobuffalo/pop/columns" - "github.com/markbates/oncer" + "github.com/gobuffalo/pop/internal/oncer" ) // If a field match with the regexp, it will be considered as a valid field definition. diff --git a/associations/belongs_to_association.go b/associations/belongs_to_association.go index c1687f76..f34b4625 100644 --- a/associations/belongs_to_association.go +++ b/associations/belongs_to_association.go @@ -7,7 +7,7 @@ import ( "github.com/gobuffalo/flect" "github.com/gobuffalo/nulls" "github.com/gobuffalo/pop/columns" - "github.com/gobuffalo/x/defaults" + "github.com/gobuffalo/pop/internal/defaults" ) // belongsToAssociation is the implementation for the belongs_to association type in a model. diff --git a/associations/has_one_association.go b/associations/has_one_association.go index a84cd8af..13e9311a 100644 --- a/associations/has_one_association.go +++ b/associations/has_one_association.go @@ -6,7 +6,7 @@ import ( "github.com/gobuffalo/flect" "github.com/gobuffalo/nulls" - "github.com/gobuffalo/x/defaults" + "github.com/gobuffalo/pop/internal/defaults" ) // hasOneAssociation is a 1 to 1 kind of association. It's used on diff --git a/associations/many_to_many_association.go b/associations/many_to_many_association.go index 18d16675..4cce991a 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/x/defaults" + "github.com/gobuffalo/pop/internal/defaults" "github.com/gofrs/uuid" ) diff --git a/columns/columns_for_struct.go b/columns/columns_for_struct.go index ffdfa1a6..517ddb2e 100644 --- a/columns/columns_for_struct.go +++ b/columns/columns_for_struct.go @@ -3,7 +3,7 @@ package columns import ( "reflect" - "github.com/markbates/oncer" + "github.com/gobuffalo/pop/internal/oncer" ) // ColumnsForStruct returns a Columns instance for diff --git a/connection.go b/connection.go index fdf91d57..2a4addb9 100644 --- a/connection.go +++ b/connection.go @@ -4,9 +4,9 @@ import ( "sync/atomic" "time" + "github.com/gobuffalo/pop/internal/defaults" + "github.com/gobuffalo/pop/internal/randx" "github.com/jmoiron/sqlx" - "github.com/markbates/going/defaults" - "github.com/markbates/going/randx" "github.com/pkg/errors" ) diff --git a/connection_details.go b/connection_details.go index 1e7f37a9..2e7919e0 100644 --- a/connection_details.go +++ b/connection_details.go @@ -8,9 +8,9 @@ import ( "strings" "time" + "github.com/gobuffalo/pop/internal/defaults" + "github.com/gobuffalo/pop/internal/oncer" "github.com/gobuffalo/pop/logging" - "github.com/markbates/going/defaults" - "github.com/markbates/oncer" "github.com/pkg/errors" ) diff --git a/dialect_cockroach.go b/dialect_cockroach.go index 0ef3ce25..ea3d62f9 100644 --- a/dialect_cockroach.go +++ b/dialect_cockroach.go @@ -14,9 +14,9 @@ import ( "github.com/gobuffalo/fizz" "github.com/gobuffalo/fizz/translators" "github.com/gobuffalo/pop/columns" + "github.com/gobuffalo/pop/internal/defaults" "github.com/gobuffalo/pop/logging" "github.com/jmoiron/sqlx" - "github.com/markbates/going/defaults" "github.com/pkg/errors" ) diff --git a/dialect_mysql.go b/dialect_mysql.go index 05a20c0f..14a9df9e 100644 --- a/dialect_mysql.go +++ b/dialect_mysql.go @@ -13,9 +13,9 @@ import ( "github.com/gobuffalo/fizz" "github.com/gobuffalo/fizz/translators" "github.com/gobuffalo/pop/columns" + "github.com/gobuffalo/pop/internal/defaults" + "github.com/gobuffalo/pop/internal/oncer" "github.com/gobuffalo/pop/logging" - "github.com/markbates/going/defaults" - "github.com/markbates/oncer" "github.com/pkg/errors" ) diff --git a/dialect_postgresql.go b/dialect_postgresql.go index a0ac85c6..9c57ac2d 100644 --- a/dialect_postgresql.go +++ b/dialect_postgresql.go @@ -12,10 +12,10 @@ import ( "github.com/gobuffalo/fizz" "github.com/gobuffalo/fizz/translators" "github.com/gobuffalo/pop/columns" + "github.com/gobuffalo/pop/internal/defaults" "github.com/gobuffalo/pop/logging" "github.com/jmoiron/sqlx" pg "github.com/lib/pq" - "github.com/markbates/going/defaults" "github.com/pkg/errors" ) diff --git a/dialect_sqlite.go b/dialect_sqlite.go index 366a9a75..6303c962 100644 --- a/dialect_sqlite.go +++ b/dialect_sqlite.go @@ -15,8 +15,8 @@ import ( "github.com/gobuffalo/fizz" "github.com/gobuffalo/fizz/translators" "github.com/gobuffalo/pop/columns" + "github.com/gobuffalo/pop/internal/defaults" "github.com/gobuffalo/pop/logging" - "github.com/markbates/going/defaults" _ "github.com/mattn/go-sqlite3" // Load SQLite3 CGo driver "github.com/pkg/errors" ) diff --git a/internal/defaults/defaults.go b/internal/defaults/defaults.go new file mode 100644 index 00000000..0d81de6f --- /dev/null +++ b/internal/defaults/defaults.go @@ -0,0 +1,36 @@ +package defaults + +func String(s1, s2 string) string { + if s1 == "" { + return s2 + } + return s1 +} + +func Int(i1, i2 int) int { + if i1 == 0 { + return i2 + } + return i1 +} + +func Int64(i1, i2 int64) int64 { + if i1 == 0 { + return i2 + } + return i1 +} + +func Float32(i1, i2 float32) float32 { + if i1 == 0.0 { + return i2 + } + return i1 +} + +func Float64(i1, i2 float64) float64 { + if i1 == 0.0 { + return i2 + } + return i1 +} diff --git a/internal/defaults/defaults_test.go b/internal/defaults/defaults_test.go new file mode 100644 index 00000000..f757e8f8 --- /dev/null +++ b/internal/defaults/defaults_test.go @@ -0,0 +1,52 @@ +package defaults + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_String(t *testing.T) { + a := assert.New(t) + + a.Equal(String("", "foo"), "foo") + a.Equal(String("bar", "foo"), "bar") + var s string + a.Equal(String(s, "foo"), "foo") +} + +func Test_Int(t *testing.T) { + a := assert.New(t) + + a.Equal(Int(0, 1), 1) + a.Equal(Int(2, 1), 2) + var s int + a.Equal(Int(s, 1), 1) +} + +func Test_Int64(t *testing.T) { + a := assert.New(t) + + a.Equal(Int64(0, 1), int64(1)) + a.Equal(Int64(2, 1), int64(2)) + var s int64 + a.Equal(Int64(s, 1), int64(1)) +} + +func Test_Float32(t *testing.T) { + a := assert.New(t) + + a.Equal(Float32(0, 1), float32(1)) + a.Equal(Float32(2, 1), float32(2)) + var s float32 + a.Equal(Float32(s, 1), float32(1)) +} + +func Test_Float64(t *testing.T) { + a := assert.New(t) + + a.Equal(Float64(0, 1), float64(1)) + a.Equal(Float64(2, 1), float64(2)) + var s float64 + a.Equal(Float64(s, 1), float64(1)) +} diff --git a/internal/oncer/deprecate.go b/internal/oncer/deprecate.go new file mode 100644 index 00000000..4eb3a443 --- /dev/null +++ b/internal/oncer/deprecate.go @@ -0,0 +1,20 @@ +package oncer + +import ( + "fmt" + "io" + "os" +) + +const deprecated = "DEPRECATED" + +var deprecationWriter io.Writer = os.Stdout + +func Deprecate(depth int, name string, msg string) { + Do(deprecated+name, func() { + fmt.Fprintf(deprecationWriter, "[%s] %s has been deprecated.\n", deprecated, name) + if len(msg) > 0 { + fmt.Fprintf(deprecationWriter, "\t%s\n", msg) + } + }) +} diff --git a/internal/oncer/oncer.go b/internal/oncer/oncer.go new file mode 100644 index 00000000..7da0cfb0 --- /dev/null +++ b/internal/oncer/oncer.go @@ -0,0 +1,26 @@ +package oncer + +import ( + "sync" +) + +var onces = &sync.Map{} + +func Do(name string, fn func()) { + o, _ := onces.LoadOrStore(name, &sync.Once{}) + if once, ok := o.(*sync.Once); ok { + once.Do(fn) + } +} + +func Reset(names ...string) { + if len(names) == 0 { + onces = &sync.Map{} + return + } + + for _, n := range names { + onces.Delete(n) + onces.Delete(deprecated + n) + } +} diff --git a/internal/randx/randx.go b/internal/randx/randx.go new file mode 100644 index 00000000..14dad24a --- /dev/null +++ b/internal/randx/randx.go @@ -0,0 +1,10 @@ +package randx + +import ( + "math/rand" + "time" +) + +func init() { + rand.Seed(time.Now().UnixNano()) +} diff --git a/internal/randx/string.go b/internal/randx/string.go new file mode 100644 index 00000000..59734a4f --- /dev/null +++ b/internal/randx/string.go @@ -0,0 +1,35 @@ +package randx + +import ( + "math/rand" + "time" +) + +// source https://stackoverflow.com/questions/22892120/how-to-generate-a-random-string-of-a-fixed-length-in-go + +const letterBytes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" +const ( + letterIdxBits = 6 // 6 bits to represent a letter index + letterIdxMask = 1<= 0; { + if remain == 0 { + cache, remain = src.Int63(), letterIdxMax + } + if idx := int(cache & letterIdxMask); idx < len(letterBytes) { + b[i] = letterBytes[idx] + i-- + } + cache >>= letterIdxBits + remain-- + } + + return string(b) +} diff --git a/internal/randx/string_test.go b/internal/randx/string_test.go new file mode 100644 index 00000000..92a42a43 --- /dev/null +++ b/internal/randx/string_test.go @@ -0,0 +1,18 @@ +package randx + +import ( + "math/rand" + "testing" + + "github.com/stretchr/testify/require" +) + +func init() { + rand.Seed(1) +} + +func Test_String(t *testing.T) { + r := require.New(t) + r.Len(String(5), 5) + r.Len(String(50), 50) +} diff --git a/logger.go b/logger.go index 69ee4a9b..31e4ea03 100644 --- a/logger.go +++ b/logger.go @@ -6,8 +6,8 @@ import ( "os" "github.com/fatih/color" + "github.com/gobuffalo/pop/internal/oncer" "github.com/gobuffalo/pop/logging" - "github.com/markbates/oncer" ) type logger func(lvl logging.Level, s string, args ...interface{}) diff --git a/migration.go b/migration.go index 557488c2..65a62c1c 100644 --- a/migration.go +++ b/migration.go @@ -6,7 +6,7 @@ import ( "time" "github.com/gobuffalo/makr" - "github.com/markbates/oncer" + "github.com/gobuffalo/pop/internal/oncer" ) // MigrationCreate writes contents for a given migration in normalized files diff --git a/packrd/packed-packr.go b/packrd/packed-packr.go index 35a7d254..45de3ef5 100644 --- a/packrd/packed-packr.go +++ b/packrd/packed-packr.go @@ -11,26 +11,33 @@ import ( ) var _ = func() error { - const gk = "251d576975f593cab8f44e1ed7243ea6" + const gk = "85ed832011d53646a0e820318abdc4c7" g := packr.New(gk, "") hgr, err := resolver.NewHexGzip(map[string]string{ - "50f60207eb74d1b7f2b9b07fa815c278": "1f8b08000000000000ffecd1416b32311006e0fbfe8a21df7d51c14fd89b6c05c1426463293d494ca6b8189d25136dcb92ff5e62517b28dbe24df03ae4c99bc96bf1808e9a2dee429101d85a3b34a1004366e3499b751aeaa0579ab180b6cda9099ccf3dbed6ef312ebff10c604d1cd221d1b62246c0dd417a10a52c67951c97d3e554aa8500d11f8cf25edecbfb0220c60ca021dfe9e6b24a6ef07f301c9dcc9ed177992735a904084f14ce319af98dbced8c1a2bf52cab0701e2f23a72050c33006a424d3b4e1f05c0ecb664b1005bb35e393c0eff31bb1469b07b23a51e9795948b7272dcec14f575c15ff08f70831fbfb9d9e4e5ccb2807c55ebc9ddebbeb9ba1b4f766fd24ed7947ed1f7ea6fadfacf000000ffff1757d2dbe6050000", - "5326a1f49e88f03a1e5f2c3a40e54348": "1f8b08000000000000ffac94516bdb400cc7dffb29340f460b251d648c61285bb61656284d4952c69ee28bad24c7ce2757a74b1742befb909d3849b70c56f69060cb27e92ffda42b70818eaa12bda4270085350e7349212997e1d1256a32622626600ac96ad5a14a42e79e716a7faed7e33d6f3d3aa7a0ae8e72e3f4596d15b1dabaddb7eff53506e41412266abe9a109e888bd67422188e2979ad3ff84e1172e335121808d6cf1cc2c3e01682b0f533981283cc1182291172f2533b8b6cc4924fb73122bb6ddcf4e24213a7faf7e9b4559eaadeb38bdf0a56751f2bc30147b6c44be1886fcae8c40ec5086a1f42636434851ea12897ddb0537f478220732360a7b0a45897914576d93990cc910f2507308c10ac432f6e0976e689b1e8d4a16e3cc8dc06c84dc0f3ba64ed421983680c31d683710e181fa3652cd4e831d7a8501936250a72e86c94fd8db216fdbff0564c45cc0f68b4448d0b54f703fdc232796da771b0306ccdc4610021a00532db0261615cc40076db84ba6b9d03c2ab55b25a25eb35fa459f21b9ea8d7a9f7bc3ebf1c3e0367919fe9dfa970cc17abd6df6bf6dd92eeb8ec2b1dabef687a3649f519db4a174cce7be3f509f9a617dbca178b47dc3eb41b201da446f291fcdd01b0ebff50757076e0dfc9e2fea3d6807a025fcc77985c912028ae8a65b81e80b64a0aade9596fee6bd9e3095b721958252698ccf78ed7fdaa39642373446f43915d6cf5248a24c3f949377e3197a64e3c6b9ddadf797dec3e8a67ff7aa7182accd9d81f145f63c6dd6aceb04b5261def4c6564faf444fc032aa60ad92d3b9b7837cd9da1778227811019cfa1a0fa259f1b3f433825d660677a2184ed9a744e7e050000ffff79f0e5cfe8050000", - "e2475e65981b98fa738efc3c4b639c69": "1f8b08000000000000ffac8ec14a03311086ef798a210f906dab450888aed89ba0d8f5bca4cda80be94ec8cc5621e4dd2542ab45bd79fbf9997fbecfe31e03c51d8e6215801f5cc0ad5888c4f292906be7c46d1ca3859c0d4561f390f079782fa5ffb6560013633a5946c7fc46c99f94afc46261beb830333333f37a46142c2c9512e44f8b29850ad339eb5270dcdf27d0dd6addf5b76dd7deb4eb55fff478a7411fbedaa639c643b83e12ecf2fc6cd1fc70afb02be6b0238f977e60b709a84b512a26f2d356061aff72f94f8d2fda6f321f010000ffffb44a8cd79f010000", - "fb34aa975abbcb40d48be167668d4187": "1f8b08000000000000ff4a492d4bcdc92fc84dcd2bb1e2525048c94ccc494d2eb152502a2eccc92c4935560209269624262516a75a295457ebe5179414eb05e5e797d4d6c6c3b80145a9699915b5b5f148a6e9410ce0e22a492da686d12063e0661614e5a794269764e6e751c164846130f301010000ffffd5f1ef6a15010000", + "9618adbabf83332a84dfc43a338f2fa9": "1f8b08000000000000ff4a492d4bcdc92fc84dcd2bb1e2525048c94ccc494d2eb152502a2eccc92c4935560209269624262516a75a295457ebe5179414eb05e5e797d4d6c6c3b80145a9699915b5b5f148a6e9410ce0e22a492da686d12063e0661614e5a794269764e6e751c164846130f301010000ffffd5f1ef6a15010000", + "9ff42f3be5fe4eb248729a0d4ce2b4a5": "1f8b08000000000000ffac94516bdb400cc7dffb29340f460b251d648c61285bb61656284d4952c69ee28bad24c7ce2757a74b1742befb909d3849b70c56f69060cb27e92ffda42b70818eaa12bda4270085350e7349212997e1d1256a32622626600ac96ad5a14a42e79e716a7faed7e33d6f3d3aa7a0ae8e72e3f4596d15b1dabaddb7eff53506e41412266abe9a109e888bd67422188e2979ad3ff84e1172e335121808d6cf1cc2c3e01682b0f533981283cc1182291172f2533b8b6cc4924fb73122bb6ddcf4e24213a7faf7e9b4559eaadeb38bdf0a56751f2bc30147b6c44be1886fcae8c40ec5086a1f42636434851ea12897ddb0537f478220732360a7b0a45897914576d93990cc910f2507308c10ac432f6e0976e689b1e8d4a16e3cc8dc06c84dc0f3ba64ed421983680c31d683710e181fa3652cd4e831d7a8501936250a72e86c94fd8db216fdbff0564c45cc0f68b4448d0b54f703fdc232796da771b0306ccdc4610021a00532db0261615cc40076db84ba6b9d03c2ab55b25a25eb35fa459f21b9ea8d7a9f7bc3ebf1c3e0367919fe9dfa970cc17abd6df6bf6dd92eeb8ec2b1dabef687a3649f519db4a174cce7be3f509f9a617dbca178b47dc3eb41b201da446f291fcdd01b0ebff50757076e0dfc9e2fea3d6807a025fcc77985c912028ae8a65b81e80b64a0aade9596fee6bd9e3095b721958252698ccf78ed7fdaa396423734c69c9c6b2e1148a24c3f949377e3197a64e3c6b9ddedf797dec3e8a67ff7aaf182ac4d9e81f145f63c6fd6eceb04b5289def4c7564faf444fc032aa60ad92d3b9b7837cda5a1978227811019cfa1a0fa259f1b3f433825d660677a2384ed9e744e7e050000ffff6b7d0f64e9050000", + "bc099667106b18c13352f619b84b6c79": "1f8b08000000000000ff9490cb4ef3301085f7798aa9aafc6a16b137ff86aa170995dba61bd845883af124b67032953d2e1215ef8e720116b0e9caf2f89cef1ccf1ceed11dd187242966c575b44ec3232b8ee17961988f6129a5c69350efd1a3a8a895adf2afa5620cb28c75ad1cc91775b4fdcd3a2dc3e0950d4d8fc28cf86de9555799bd6a71ddaac0e8b30b0246b6eb87bcd558dbceb2a5ee41afff5ffdfb4d2e66c51deda8fa4968485325c837b2b16c6239047d97945f25c7f6229c9aec526f96e4799eec8971094fc606a8ad43b0015464ca1becd02b462d6047b027861b6d79b024ab740d357958980c6c07130fce906e92f91c8a432f30a2ff20a49bc35fc546c56d746e526503d5d6b03062475506678f1c7d07fd7235bd75d3fca30f59a5309c9f010000ffff3df549080c020000", + "e179b9964eccf52e1795f1cc32775c88": "1f8b08000000000000ffac8ec14a03311086ef798a210f906dab450888aed89ba0d8f5bca4cda80be94ec8cc5621e4dd2542ab45bd79fbf9997fbecfe31e03c51d8e6215801f5cc0ad5888c4f292906be7c46d1ca3859c0d4561f390f079782fa5ffb6560013633a5946c7fc46c99f94afc46261beb830333333f37a46142c2c9512e44f8b29850ad339eb5270dcdf27d0dd6addf5b76dd7deb4eb55fff478a7411fbedaa639c643b83e12ecf2fc6cd1fc70afb02be6b0238f977e60b709a84b512a26f2d356061aff72f94f8d2fda6f321f010000ffffb44a8cd79f010000", + "e64e118803364e3048cc01480425f549": "1f8b08000000000000ffecd1416b32311006e0fbfe8a21df7d51c14fd89b6c05c1426463293d494ca6b8189d25136dcb92ff5e62517b28dbe24df03ae4c99bc96bf1808e9a2dee429101d85a3b34a1004366e3499b751aeaa0579ab180b6cda9099ccf3dbed6ef312ebff10c604d1cd221d1b62246c0dd417a10a52c67951c97d3e554aa8500d11f8cf25edecbfb0220c60ca021dfe9e6b24a6ef07f301c9dcc9ed177992735a904084f14ce319af98dbced8c1a2bf52cab0701e2f23a72050c33006a424d3b4e1f05c0ecb664b1005bb35e393c0eff31bb1469b07b23a51e9795948b7272dcec14f575c15ff08f70831fbfb9d9e4e5ccb2807c55ebc9ddebbeb9ba1b4f766fd24ed7947ed1f7ea6fadfacf000000ffff1757d2dbe6050000", }) if err != nil { panic(err) } g.DefaultResolver = hgr + func() { + b := packr.New("github.com/gobuffalo/helpers/genny/docs/templates", "../docs/templates") + b.SetResolver("README.md.plush", packr.Pointer{ForwardBox: gk, ForwardPath: "bc099667106b18c13352f619b84b6c79"}) + }() + + func() { b := packr.New("pop:genny:config", "../config/templates") - b.SetResolver("cockroach.yml.tmpl", packr.Pointer{ForwardBox: gk, ForwardPath: "50f60207eb74d1b7f2b9b07fa815c278"}) - b.SetResolver("mysql.yml.tmpl", packr.Pointer{ForwardBox: gk, ForwardPath: "5326a1f49e88f03a1e5f2c3a40e54348"}) - b.SetResolver("postgres.yml.tmpl", packr.Pointer{ForwardBox: gk, ForwardPath: "e2475e65981b98fa738efc3c4b639c69"}) - b.SetResolver("sqlite3.yml.tmpl", packr.Pointer{ForwardBox: gk, ForwardPath: "fb34aa975abbcb40d48be167668d4187"}) - }() + b.SetResolver("cockroach.yml.tmpl", packr.Pointer{ForwardBox: gk, ForwardPath: "e64e118803364e3048cc01480425f549"}) + b.SetResolver("mysql.yml.tmpl", packr.Pointer{ForwardBox: gk, ForwardPath: "9ff42f3be5fe4eb248729a0d4ce2b4a5"}) + b.SetResolver("postgres.yml.tmpl", packr.Pointer{ForwardBox: gk, ForwardPath: "e179b9964eccf52e1795f1cc32775c88"}) + b.SetResolver("sqlite3.yml.tmpl", packr.Pointer{ForwardBox: gk, ForwardPath: "9618adbabf83332a84dfc43a338f2fa9"}) + }() return nil }() diff --git a/paginator.go b/paginator.go index 7eba1bb8..d4afb96d 100644 --- a/paginator.go +++ b/paginator.go @@ -4,7 +4,7 @@ import ( "encoding/json" "strconv" - "github.com/markbates/going/defaults" + "github.com/gobuffalo/pop/internal/defaults" ) // PaginatorPerPageDefault is the amount of results per page diff --git a/query_joins.go b/query_joins.go index 08616122..9dc7e1e8 100644 --- a/query_joins.go +++ b/query_joins.go @@ -1,8 +1,8 @@ package pop import ( + "github.com/gobuffalo/pop/internal/oncer" "github.com/gobuffalo/pop/logging" - "github.com/markbates/oncer" ) // Join will append a JOIN clause to the query diff --git a/soda/cmd/generate/config_cmd.go b/soda/cmd/generate/config_cmd.go index af496eed..1f2f685e 100644 --- a/soda/cmd/generate/config_cmd.go +++ b/soda/cmd/generate/config_cmd.go @@ -10,8 +10,8 @@ import ( "github.com/gobuffalo/genny" "github.com/gobuffalo/pop" "github.com/gobuffalo/pop/genny/config" - "github.com/markbates/going/defaults" - "github.com/markbates/oncer" + "github.com/gobuffalo/pop/internal/defaults" + "github.com/gobuffalo/pop/internal/oncer" "github.com/spf13/cobra" ) diff --git a/soda/cmd/generate/fizz_cmd.go b/soda/cmd/generate/fizz_cmd.go index 8aa48b64..96b5226e 100644 --- a/soda/cmd/generate/fizz_cmd.go +++ b/soda/cmd/generate/fizz_cmd.go @@ -4,7 +4,7 @@ import ( "errors" "github.com/gobuffalo/pop" - "github.com/markbates/going/defaults" + "github.com/gobuffalo/pop/internal/defaults" "github.com/spf13/cobra" ) diff --git a/soda/cmd/generate/model.go b/soda/cmd/generate/model.go index 990cfe32..d3fb3048 100644 --- a/soda/cmd/generate/model.go +++ b/soda/cmd/generate/model.go @@ -18,7 +18,7 @@ import ( nflect "github.com/gobuffalo/flect/name" "github.com/gobuffalo/makr" "github.com/gobuffalo/pop" - "github.com/markbates/going/defaults" + "github.com/gobuffalo/pop/internal/defaults" "github.com/pkg/errors" ) diff --git a/soda/cmd/generate/sql_cmd.go b/soda/cmd/generate/sql_cmd.go index 70bb1e70..9ed1f843 100644 --- a/soda/cmd/generate/sql_cmd.go +++ b/soda/cmd/generate/sql_cmd.go @@ -4,7 +4,7 @@ import ( "errors" "github.com/gobuffalo/pop" - "github.com/markbates/going/defaults" + "github.com/gobuffalo/pop/internal/defaults" "github.com/spf13/cobra" ) diff --git a/soda/cmd/migrate_reset.go b/soda/cmd/migrate_reset.go index 3ab6df78..d25b2285 100644 --- a/soda/cmd/migrate_reset.go +++ b/soda/cmd/migrate_reset.go @@ -2,7 +2,7 @@ package cmd import ( "github.com/gobuffalo/pop" - "github.com/markbates/oncer" + "github.com/gobuffalo/pop/internal/oncer" "github.com/spf13/cobra" ) diff --git a/soda/cmd/root.go b/soda/cmd/root.go index e6202aaf..eda2c5b5 100644 --- a/soda/cmd/root.go +++ b/soda/cmd/root.go @@ -6,7 +6,7 @@ import ( "path/filepath" "github.com/gobuffalo/pop" - "github.com/markbates/going/defaults" + "github.com/gobuffalo/pop/internal/defaults" "github.com/spf13/cobra" )