From f9fc0536faafdfc7698587a4a163ab1e394bf709 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20W=C3=BCrbach?= Date: Mon, 12 Jun 2023 17:51:48 +0200 Subject: [PATCH] feat: bump onpar --- dialect_mysql_test.go | 107 +++++++-------- dialect_postgres_test.go | 101 ++++++++------- dialect_snowflake_test.go | 264 +++++++++++++++++++------------------- go.mod | 21 +-- go.sum | 164 +---------------------- 5 files changed, 256 insertions(+), 401 deletions(-) diff --git a/dialect_mysql_test.go b/dialect_mysql_test.go index 6309c414..6c747264 100644 --- a/dialect_mysql_test.go +++ b/dialect_mysql_test.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. +//go:build !integration // +build !integration package gorp_test @@ -21,15 +22,21 @@ import ( ) func TestMySQLDialect(t *testing.T) { - o := onpar.New() - defer o.Run(t) + type testContext struct { + expect expect.Expectation + dialect gorp.MySQLDialect + } - o.BeforeEach(func(t *testing.T) (expect.Expectation, gorp.MySQLDialect) { - return expect.New(t), gorp.MySQLDialect{ - Engine: "foo", - Encoding: "bar", + o := onpar.BeforeEach(onpar.New(t), func(t *testing.T) testContext { + return testContext{ + expect: expect.New(t), + dialect: gorp.MySQLDialect{ + Engine: "foo", + Encoding: "bar", + }, } }) + defer o.Run() o.Group("ToSqlType", func() { tests := []struct { @@ -62,97 +69,97 @@ func TestMySQLDialect(t *testing.T) { {"large string", "", 1024, false, "text"}, } for _, t := range tests { - o.Spec(t.name, func(expect expect.Expectation, dialect gorp.MySQLDialect) { + o.Spec(t.name, func(tt testContext) { typ := reflect.TypeOf(t.value) - sqlType := dialect.ToSqlType(typ, t.maxSize, t.autoIncr) - expect(sqlType).To(matchers.Equal(t.expected)) + sqlType := tt.dialect.ToSqlType(typ, t.maxSize, t.autoIncr) + tt.expect(sqlType).To(matchers.Equal(t.expected)) }) } }) - o.Spec("AutoIncrStr", func(expect expect.Expectation, dialect gorp.MySQLDialect) { - expect(dialect.AutoIncrStr()).To(matchers.Equal("auto_increment")) + o.Spec("AutoIncrStr", func(tt testContext) { + tt.expect(tt.dialect.AutoIncrStr()).To(matchers.Equal("auto_increment")) }) - o.Spec("AutoIncrBindValue", func(expect expect.Expectation, dialect gorp.MySQLDialect) { - expect(dialect.AutoIncrBindValue()).To(matchers.Equal("null")) + o.Spec("AutoIncrBindValue", func(tt testContext) { + tt.expect(tt.dialect.AutoIncrBindValue()).To(matchers.Equal("null")) }) - o.Spec("AutoIncrInsertSuffix", func(expect expect.Expectation, dialect gorp.MySQLDialect) { - expect(dialect.AutoIncrInsertSuffix(nil)).To(matchers.Equal("")) + o.Spec("AutoIncrInsertSuffix", func(tt testContext) { + tt.expect(tt.dialect.AutoIncrInsertSuffix(nil)).To(matchers.Equal("")) }) o.Group("CreateTableSuffix", func() { o.Group("with an empty engine", func() { - o.BeforeEach(func(expect expect.Expectation, dialect gorp.MySQLDialect) (expect.Expectation, gorp.MySQLDialect) { - dialect.Engine = "" - return expect, dialect + o := onpar.BeforeEach(o, func(tt testContext) testContext { + tt.dialect.Engine = "" + return tt }) - o.Spec("panics", func(expect expect.Expectation, dialect gorp.MySQLDialect) { - expect(func() { dialect.CreateTableSuffix() }).To(Panic()) + o.Spec("panics", func(tt testContext) { + tt.expect(func() { tt.dialect.CreateTableSuffix() }).To(Panic()) }) }) o.Group("with an empty encoding", func() { - o.BeforeEach(func(expect expect.Expectation, dialect gorp.MySQLDialect) (expect.Expectation, gorp.MySQLDialect) { - dialect.Encoding = "" - return expect, dialect + o := onpar.BeforeEach(o, func(tt testContext) testContext { + tt.dialect.Encoding = "" + return tt }) - o.Spec("panics", func(expect expect.Expectation, dialect gorp.MySQLDialect) { - expect(func() { dialect.CreateTableSuffix() }).To(Panic()) + o.Spec("panics", func(tt testContext) { + tt.expect(func() { tt.dialect.CreateTableSuffix() }).To(Panic()) }) }) - o.Spec("with an engine and an encoding", func(expect expect.Expectation, dialect gorp.MySQLDialect) { - expect(dialect.CreateTableSuffix()).To(matchers.Equal(" engine=foo charset=bar")) + o.Spec("with an engine and an encoding", func(tt testContext) { + tt.expect(tt.dialect.CreateTableSuffix()).To(matchers.Equal(" engine=foo charset=bar")) }) }) - o.Spec("CreateIndexSuffix", func(expect expect.Expectation, dialect gorp.MySQLDialect) { - expect(dialect.CreateIndexSuffix()).To(matchers.Equal("using")) + o.Spec("CreateIndexSuffix", func(tt testContext) { + tt.expect(tt.dialect.CreateIndexSuffix()).To(matchers.Equal("using")) }) - o.Spec("DropIndexSuffix", func(expect expect.Expectation, dialect gorp.MySQLDialect) { - expect(dialect.DropIndexSuffix()).To(matchers.Equal("on")) + o.Spec("DropIndexSuffix", func(tt testContext) { + tt.expect(tt.dialect.DropIndexSuffix()).To(matchers.Equal("on")) }) - o.Spec("TruncateClause", func(expect expect.Expectation, dialect gorp.MySQLDialect) { - expect(dialect.TruncateClause()).To(matchers.Equal("truncate")) + o.Spec("TruncateClause", func(tt testContext) { + tt.expect(tt.dialect.TruncateClause()).To(matchers.Equal("truncate")) }) - o.Spec("SleepClause", func(expect expect.Expectation, dialect gorp.MySQLDialect) { - expect(dialect.SleepClause(1 * time.Second)).To(matchers.Equal("sleep(1.000000)")) - expect(dialect.SleepClause(100 * time.Millisecond)).To(matchers.Equal("sleep(0.100000)")) + o.Spec("SleepClause", func(tt testContext) { + tt.expect(tt.dialect.SleepClause(1 * time.Second)).To(matchers.Equal("sleep(1.000000)")) + tt.expect(tt.dialect.SleepClause(100 * time.Millisecond)).To(matchers.Equal("sleep(0.100000)")) }) - o.Spec("BindVar", func(expect expect.Expectation, dialect gorp.MySQLDialect) { - expect(dialect.BindVar(0)).To(matchers.Equal("?")) + o.Spec("BindVar", func(tt testContext) { + tt.expect(tt.dialect.BindVar(0)).To(matchers.Equal("?")) }) - o.Spec("QuoteField", func(expect expect.Expectation, dialect gorp.MySQLDialect) { - expect(dialect.QuoteField("foo")).To(matchers.Equal("`foo`")) + o.Spec("QuoteField", func(tt testContext) { + tt.expect(tt.dialect.QuoteField("foo")).To(matchers.Equal("`foo`")) }) o.Group("QuotedTableForQuery", func() { - o.Spec("using the default schema", func(expect expect.Expectation, dialect gorp.MySQLDialect) { - expect(dialect.QuotedTableForQuery("", "foo")).To(matchers.Equal("`foo`")) + o.Spec("using the default schema", func(tt testContext) { + tt.expect(tt.dialect.QuotedTableForQuery("", "foo")).To(matchers.Equal("`foo`")) }) - o.Spec("with a supplied schema", func(expect expect.Expectation, dialect gorp.MySQLDialect) { - expect(dialect.QuotedTableForQuery("foo", "bar")).To(matchers.Equal("foo.`bar`")) + o.Spec("with a supplied schema", func(tt testContext) { + tt.expect(tt.dialect.QuotedTableForQuery("foo", "bar")).To(matchers.Equal("foo.`bar`")) }) }) - o.Spec("IfSchemaNotExists", func(expect expect.Expectation, dialect gorp.MySQLDialect) { - expect(dialect.IfSchemaNotExists("foo", "bar")).To(matchers.Equal("foo if not exists")) + o.Spec("IfSchemaNotExists", func(tt testContext) { + tt.expect(tt.dialect.IfSchemaNotExists("foo", "bar")).To(matchers.Equal("foo if not exists")) }) - o.Spec("IfTableExists", func(expect expect.Expectation, dialect gorp.MySQLDialect) { - expect(dialect.IfTableExists("foo", "bar", "baz")).To(matchers.Equal("foo if exists")) + o.Spec("IfTableExists", func(tt testContext) { + tt.expect(tt.dialect.IfTableExists("foo", "bar", "baz")).To(matchers.Equal("foo if exists")) }) - o.Spec("IfTableNotExists", func(expect expect.Expectation, dialect gorp.MySQLDialect) { - expect(dialect.IfTableNotExists("foo", "bar", "baz")).To(matchers.Equal("foo if not exists")) + o.Spec("IfTableNotExists", func(tt testContext) { + tt.expect(tt.dialect.IfTableNotExists("foo", "bar", "baz")).To(matchers.Equal("foo if not exists")) }) } diff --git a/dialect_postgres_test.go b/dialect_postgres_test.go index f9dc1c2f..1666af82 100644 --- a/dialect_postgres_test.go +++ b/dialect_postgres_test.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. +//go:build !integration // +build !integration package gorp_test @@ -19,14 +20,20 @@ import ( ) func TestPostgresDialect(t *testing.T) { - o := onpar.New() - defer o.Run(t) - - o.BeforeEach(func(t *testing.T) (expect.Expectation, gorp.PostgresDialect) { - return expect.New(t), gorp.PostgresDialect{ - LowercaseFields: false, + type testContext struct { + expect expect.Expectation + dialect gorp.PostgresDialect + } + + o := onpar.BeforeEach(onpar.New(t), func(t *testing.T) testContext { + return testContext{ + expect: expect.New(t), + dialect: gorp.PostgresDialect{ + LowercaseFields: false, + }, } }) + defer o.Run() o.Group("ToSqlType", func() { tests := []struct { @@ -59,92 +66,92 @@ func TestPostgresDialect(t *testing.T) { {"large string", "", 1024, false, "varchar(1024)"}, } for _, t := range tests { - o.Spec(t.name, func(expect expect.Expectation, dialect gorp.PostgresDialect) { + o.Spec(t.name, func(tt testContext) { typ := reflect.TypeOf(t.value) - sqlType := dialect.ToSqlType(typ, t.maxSize, t.autoIncr) - expect(sqlType).To(matchers.Equal(t.expected)) + sqlType := tt.dialect.ToSqlType(typ, t.maxSize, t.autoIncr) + tt.expect(sqlType).To(matchers.Equal(t.expected)) }) } }) - o.Spec("AutoIncrStr", func(expect expect.Expectation, dialect gorp.PostgresDialect) { - expect(dialect.AutoIncrStr()).To(matchers.Equal("")) + o.Spec("AutoIncrStr", func(tt testContext) { + tt.expect(tt.dialect.AutoIncrStr()).To(matchers.Equal("")) }) - o.Spec("AutoIncrBindValue", func(expect expect.Expectation, dialect gorp.PostgresDialect) { - expect(dialect.AutoIncrBindValue()).To(matchers.Equal("default")) + o.Spec("AutoIncrBindValue", func(tt testContext) { + tt.expect(tt.dialect.AutoIncrBindValue()).To(matchers.Equal("default")) }) - o.Spec("AutoIncrInsertSuffix", func(expect expect.Expectation, dialect gorp.PostgresDialect) { + o.Spec("AutoIncrInsertSuffix", func(tt testContext) { cm := gorp.ColumnMap{ ColumnName: "foo", } - expect(dialect.AutoIncrInsertSuffix(&cm)).To(matchers.Equal(` returning "foo"`)) + tt.expect(tt.dialect.AutoIncrInsertSuffix(&cm)).To(matchers.Equal(` returning "foo"`)) }) - o.Spec("CreateTableSuffix", func(expect expect.Expectation, dialect gorp.PostgresDialect) { - expect(dialect.CreateTableSuffix()).To(matchers.Equal("")) + o.Spec("CreateTableSuffix", func(tt testContext) { + tt.expect(tt.dialect.CreateTableSuffix()).To(matchers.Equal("")) }) - o.Spec("CreateIndexSuffix", func(expect expect.Expectation, dialect gorp.PostgresDialect) { - expect(dialect.CreateIndexSuffix()).To(matchers.Equal("using")) + o.Spec("CreateIndexSuffix", func(tt testContext) { + tt.expect(tt.dialect.CreateIndexSuffix()).To(matchers.Equal("using")) }) - o.Spec("DropIndexSuffix", func(expect expect.Expectation, dialect gorp.PostgresDialect) { - expect(dialect.DropIndexSuffix()).To(matchers.Equal("")) + o.Spec("DropIndexSuffix", func(tt testContext) { + tt.expect(tt.dialect.DropIndexSuffix()).To(matchers.Equal("")) }) - o.Spec("TruncateClause", func(expect expect.Expectation, dialect gorp.PostgresDialect) { - expect(dialect.TruncateClause()).To(matchers.Equal("truncate")) + o.Spec("TruncateClause", func(tt testContext) { + tt.expect(tt.dialect.TruncateClause()).To(matchers.Equal("truncate")) }) - o.Spec("SleepClause", func(expect expect.Expectation, dialect gorp.PostgresDialect) { - expect(dialect.SleepClause(1 * time.Second)).To(matchers.Equal("pg_sleep(1.000000)")) - expect(dialect.SleepClause(100 * time.Millisecond)).To(matchers.Equal("pg_sleep(0.100000)")) + o.Spec("SleepClause", func(tt testContext) { + tt.expect(tt.dialect.SleepClause(1 * time.Second)).To(matchers.Equal("pg_sleep(1.000000)")) + tt.expect(tt.dialect.SleepClause(100 * time.Millisecond)).To(matchers.Equal("pg_sleep(0.100000)")) }) - o.Spec("BindVar", func(expect expect.Expectation, dialect gorp.PostgresDialect) { - expect(dialect.BindVar(0)).To(matchers.Equal("$1")) - expect(dialect.BindVar(4)).To(matchers.Equal("$5")) + o.Spec("BindVar", func(tt testContext) { + tt.expect(tt.dialect.BindVar(0)).To(matchers.Equal("$1")) + tt.expect(tt.dialect.BindVar(4)).To(matchers.Equal("$5")) }) o.Group("QuoteField", func() { - o.Spec("By default, case is preserved", func(expect expect.Expectation, dialect gorp.PostgresDialect) { - expect(dialect.QuoteField("Foo")).To(matchers.Equal(`"Foo"`)) - expect(dialect.QuoteField("bar")).To(matchers.Equal(`"bar"`)) + o.Spec("By default, case is preserved", func(tt testContext) { + tt.expect(tt.dialect.QuoteField("Foo")).To(matchers.Equal(`"Foo"`)) + tt.expect(tt.dialect.QuoteField("bar")).To(matchers.Equal(`"bar"`)) }) o.Group("With LowercaseFields set to true", func() { - o.BeforeEach(func(expect expect.Expectation, dialect gorp.PostgresDialect) (expect.Expectation, gorp.PostgresDialect) { - dialect.LowercaseFields = true - return expect, dialect + o := onpar.BeforeEach(o, func(tt testContext) testContext { + tt.dialect.LowercaseFields = true + return tt }) - o.Spec("fields are lowercased", func(expect expect.Expectation, dialect gorp.PostgresDialect) { - expect(dialect.QuoteField("Foo")).To(matchers.Equal(`"foo"`)) + o.Spec("fields are lowercased", func(tt testContext) { + tt.expect(tt.dialect.QuoteField("Foo")).To(matchers.Equal(`"foo"`)) }) }) }) o.Group("QuotedTableForQuery", func() { - o.Spec("using the default schema", func(expect expect.Expectation, dialect gorp.PostgresDialect) { - expect(dialect.QuotedTableForQuery("", "foo")).To(matchers.Equal(`"foo"`)) + o.Spec("using the default schema", func(tt testContext) { + tt.expect(tt.dialect.QuotedTableForQuery("", "foo")).To(matchers.Equal(`"foo"`)) }) - o.Spec("with a supplied schema", func(expect expect.Expectation, dialect gorp.PostgresDialect) { - expect(dialect.QuotedTableForQuery("foo", "bar")).To(matchers.Equal(`foo."bar"`)) + o.Spec("with a supplied schema", func(tt testContext) { + tt.expect(tt.dialect.QuotedTableForQuery("foo", "bar")).To(matchers.Equal(`foo."bar"`)) }) }) - o.Spec("IfSchemaNotExists", func(expect expect.Expectation, dialect gorp.PostgresDialect) { - expect(dialect.IfSchemaNotExists("foo", "bar")).To(matchers.Equal("foo if not exists")) + o.Spec("IfSchemaNotExists", func(tt testContext) { + tt.expect(tt.dialect.IfSchemaNotExists("foo", "bar")).To(matchers.Equal("foo if not exists")) }) - o.Spec("IfTableExists", func(expect expect.Expectation, dialect gorp.PostgresDialect) { - expect(dialect.IfTableExists("foo", "bar", "baz")).To(matchers.Equal("foo if exists")) + o.Spec("IfTableExists", func(tt testContext) { + tt.expect(tt.dialect.IfTableExists("foo", "bar", "baz")).To(matchers.Equal("foo if exists")) }) - o.Spec("IfTableNotExists", func(expect expect.Expectation, dialect gorp.PostgresDialect) { - expect(dialect.IfTableNotExists("foo", "bar", "baz")).To(matchers.Equal("foo if not exists")) + o.Spec("IfTableNotExists", func(tt testContext) { + tt.expect(tt.dialect.IfTableNotExists("foo", "bar", "baz")).To(matchers.Equal("foo if not exists")) }) } diff --git a/dialect_snowflake_test.go b/dialect_snowflake_test.go index 60e6937f..7811950c 100644 --- a/dialect_snowflake_test.go +++ b/dialect_snowflake_test.go @@ -8,136 +8,142 @@ package gorp_test import ( - "database/sql" - "reflect" - "testing" - "time" - - "github.com/go-gorp/gorp/v3" - "github.com/poy/onpar" - "github.com/poy/onpar/expect" - "github.com/poy/onpar/matchers" + "database/sql" + "reflect" + "testing" + "time" + + "github.com/go-gorp/gorp/v3" + "github.com/poy/onpar" + "github.com/poy/onpar/expect" + "github.com/poy/onpar/matchers" ) func TestSnowflakeDialect(t *testing.T) { - o := onpar.New() - defer o.Run(t) - - o.BeforeEach(func(t *testing.T) (expect.Expectation, gorp.SnowflakeDialect) { - return expect.New(t), gorp.SnowflakeDialect{ - LowercaseFields: false, - } - }) - - o.Group("ToSqlType", func() { - tests := []struct { - name string - value interface{} - maxSize int - autoIncr bool - expected string - }{ - {"bool", true, 0, false, "boolean"}, - {"int8", int8(1), 0, false, "integer"}, - {"uint8", uint8(1), 0, false, "integer"}, - {"int16", int16(1), 0, false, "integer"}, - {"uint16", uint16(1), 0, false, "integer"}, - {"int32", int32(1), 0, false, "integer"}, - {"int (treated as int32)", int(1), 0, false, "integer"}, - {"uint32", uint32(1), 0, false, "integer"}, - {"uint (treated as uint32)", uint(1), 0, false, "integer"}, - {"int64", int64(1), 0, false, "bigint"}, - {"uint64", uint64(1), 0, false, "bigint"}, - {"float32", float32(1), 0, false, "real"}, - {"float64", float64(1), 0, false, "double precision"}, - {"[]uint8", []uint8{1}, 0, false, "bytea"}, - {"NullInt64", sql.NullInt64{}, 0, false, "bigint"}, - {"NullFloat64", sql.NullFloat64{}, 0, false, "double precision"}, - {"NullBool", sql.NullBool{}, 0, false, "boolean"}, - {"Time", time.Time{}, 0, false, "timestamp with time zone"}, - {"default-size string", "", 0, false, "text"}, - {"sized string", "", 50, false, "varchar(50)"}, - {"large string", "", 1024, false, "varchar(1024)"}, - } - for _, t := range tests { - o.Spec(t.name, func(expect expect.Expectation, dialect gorp.SnowflakeDialect) { - typ := reflect.TypeOf(t.value) - sqlType := dialect.ToSqlType(typ, t.maxSize, t.autoIncr) - expect(sqlType).To(matchers.Equal(t.expected)) - }) - } - }) - - o.Spec("AutoIncrStr", func(expect expect.Expectation, dialect gorp.SnowflakeDialect) { - expect(dialect.AutoIncrStr()).To(matchers.Equal("")) - }) - - o.Spec("AutoIncrBindValue", func(expect expect.Expectation, dialect gorp.SnowflakeDialect) { - expect(dialect.AutoIncrBindValue()).To(matchers.Equal("default")) - }) - - o.Spec("AutoIncrInsertSuffix", func(expect expect.Expectation, dialect gorp.SnowflakeDialect) { - expect(dialect.AutoIncrInsertSuffix(nil)).To(matchers.Equal("")) - }) - - o.Spec("CreateTableSuffix", func(expect expect.Expectation, dialect gorp.SnowflakeDialect) { - expect(dialect.CreateTableSuffix()).To(matchers.Equal("")) - }) - - o.Spec("CreateIndexSuffix", func(expect expect.Expectation, dialect gorp.SnowflakeDialect) { - expect(dialect.CreateIndexSuffix()).To(matchers.Equal("")) - }) - - o.Spec("DropIndexSuffix", func(expect expect.Expectation, dialect gorp.SnowflakeDialect) { - expect(dialect.DropIndexSuffix()).To(matchers.Equal("")) - }) - - o.Spec("TruncateClause", func(expect expect.Expectation, dialect gorp.SnowflakeDialect) { - expect(dialect.TruncateClause()).To(matchers.Equal("truncate")) - }) - - o.Spec("BindVar", func(expect expect.Expectation, dialect gorp.SnowflakeDialect) { - expect(dialect.BindVar(0)).To(matchers.Equal("?")) - expect(dialect.BindVar(4)).To(matchers.Equal("?")) - }) - - o.Group("QuoteField", func() { - o.Spec("By default, case is preserved", func(expect expect.Expectation, dialect gorp.SnowflakeDialect) { - expect(dialect.QuoteField("Foo")).To(matchers.Equal(`"Foo"`)) - expect(dialect.QuoteField("bar")).To(matchers.Equal(`"bar"`)) - }) - - o.Group("With LowercaseFields set to true", func() { - o.BeforeEach(func(expect expect.Expectation, dialect gorp.SnowflakeDialect) (expect.Expectation, gorp.SnowflakeDialect) { - dialect.LowercaseFields = true - return expect, dialect - }) - - o.Spec("fields are lowercased", func(expect expect.Expectation, dialect gorp.SnowflakeDialect) { - expect(dialect.QuoteField("Foo")).To(matchers.Equal(`"foo"`)) - }) - }) - }) - - o.Group("QuotedTableForQuery", func() { - o.Spec("using the default schema", func(expect expect.Expectation, dialect gorp.SnowflakeDialect) { - expect(dialect.QuotedTableForQuery("", "foo")).To(matchers.Equal(`"foo"`)) - }) - - o.Spec("with a supplied schema", func(expect expect.Expectation, dialect gorp.SnowflakeDialect) { - expect(dialect.QuotedTableForQuery("foo", "bar")).To(matchers.Equal(`foo."bar"`)) - }) - }) - - o.Spec("IfSchemaNotExists", func(expect expect.Expectation, dialect gorp.SnowflakeDialect) { - expect(dialect.IfSchemaNotExists("foo", "bar")).To(matchers.Equal("foo if not exists")) - }) - - o.Spec("IfTableExists", func(expect expect.Expectation, dialect gorp.SnowflakeDialect) { - expect(dialect.IfTableExists("foo", "bar", "baz")).To(matchers.Equal("foo if exists")) - }) - - o.Spec("IfTableNotExists", func(expect expect.Expectation, dialect gorp.SnowflakeDialect) { - expect(dialect.IfTableNotExists("foo", "bar", "baz")).To(matchers.Equal("foo if not exists")) - }) + type testContext struct { + expect expect.Expectation + dialect gorp.SnowflakeDialect + } + + o := onpar.BeforeEach(onpar.New(t), func(t *testing.T) testContext { + return testContext{ + expect: expect.New(t), + dialect: gorp.SnowflakeDialect{ + LowercaseFields: false, + }, + } + }) + defer o.Run() + + o.Group("ToSqlType", func() { + tests := []struct { + name string + value interface{} + maxSize int + autoIncr bool + expected string + }{ + {"bool", true, 0, false, "boolean"}, + {"int8", int8(1), 0, false, "integer"}, + {"uint8", uint8(1), 0, false, "integer"}, + {"int16", int16(1), 0, false, "integer"}, + {"uint16", uint16(1), 0, false, "integer"}, + {"int32", int32(1), 0, false, "integer"}, + {"int (treated as int32)", int(1), 0, false, "integer"}, + {"uint32", uint32(1), 0, false, "integer"}, + {"uint (treated as uint32)", uint(1), 0, false, "integer"}, + {"int64", int64(1), 0, false, "bigint"}, + {"uint64", uint64(1), 0, false, "bigint"}, + {"float32", float32(1), 0, false, "real"}, + {"float64", float64(1), 0, false, "double precision"}, + {"[]uint8", []uint8{1}, 0, false, "bytea"}, + {"NullInt64", sql.NullInt64{}, 0, false, "bigint"}, + {"NullFloat64", sql.NullFloat64{}, 0, false, "double precision"}, + {"NullBool", sql.NullBool{}, 0, false, "boolean"}, + {"Time", time.Time{}, 0, false, "timestamp with time zone"}, + {"default-size string", "", 0, false, "text"}, + {"sized string", "", 50, false, "varchar(50)"}, + {"large string", "", 1024, false, "varchar(1024)"}, + } + for _, t := range tests { + o.Spec(t.name, func(tt testContext) { + typ := reflect.TypeOf(t.value) + sqlType := tt.dialect.ToSqlType(typ, t.maxSize, t.autoIncr) + tt.expect(sqlType).To(matchers.Equal(t.expected)) + }) + } + }) + + o.Spec("AutoIncrStr", func(tt testContext) { + tt.expect(tt.dialect.AutoIncrStr()).To(matchers.Equal("")) + }) + + o.Spec("AutoIncrBindValue", func(tt testContext) { + tt.expect(tt.dialect.AutoIncrBindValue()).To(matchers.Equal("default")) + }) + + o.Spec("AutoIncrInsertSuffix", func(tt testContext) { + tt.expect(tt.dialect.AutoIncrInsertSuffix(nil)).To(matchers.Equal("")) + }) + + o.Spec("CreateTableSuffix", func(tt testContext) { + tt.expect(tt.dialect.CreateTableSuffix()).To(matchers.Equal("")) + }) + + o.Spec("CreateIndexSuffix", func(tt testContext) { + tt.expect(tt.dialect.CreateIndexSuffix()).To(matchers.Equal("")) + }) + + o.Spec("DropIndexSuffix", func(tt testContext) { + tt.expect(tt.dialect.DropIndexSuffix()).To(matchers.Equal("")) + }) + + o.Spec("TruncateClause", func(tt testContext) { + tt.expect(tt.dialect.TruncateClause()).To(matchers.Equal("truncate")) + }) + + o.Spec("BindVar", func(tt testContext) { + tt.expect(tt.dialect.BindVar(0)).To(matchers.Equal("?")) + tt.expect(tt.dialect.BindVar(4)).To(matchers.Equal("?")) + }) + + o.Group("QuoteField", func() { + o.Spec("By default, case is preserved", func(tt testContext) { + tt.expect(tt.dialect.QuoteField("Foo")).To(matchers.Equal(`"Foo"`)) + tt.expect(tt.dialect.QuoteField("bar")).To(matchers.Equal(`"bar"`)) + }) + + o.Group("With LowercaseFields set to true", func() { + o := onpar.BeforeEach(o, func(tt testContext) testContext { + tt.dialect.LowercaseFields = true + return tt + }) + + o.Spec("fields are lowercased", func(tt testContext) { + tt.expect(tt.dialect.QuoteField("Foo")).To(matchers.Equal(`"foo"`)) + }) + }) + }) + + o.Group("QuotedTableForQuery", func() { + o.Spec("using the default schema", func(tt testContext) { + tt.expect(tt.dialect.QuotedTableForQuery("", "foo")).To(matchers.Equal(`"foo"`)) + }) + + o.Spec("with a supplied schema", func(tt testContext) { + tt.expect(tt.dialect.QuotedTableForQuery("foo", "bar")).To(matchers.Equal(`foo."bar"`)) + }) + }) + + o.Spec("IfSchemaNotExists", func(tt testContext) { + tt.expect(tt.dialect.IfSchemaNotExists("foo", "bar")).To(matchers.Equal("foo if not exists")) + }) + + o.Spec("IfTableExists", func(tt testContext) { + tt.expect(tt.dialect.IfTableExists("foo", "bar", "baz")).To(matchers.Equal("foo if exists")) + }) + + o.Spec("IfTableNotExists", func(tt testContext) { + tt.expect(tt.dialect.IfTableNotExists("foo", "bar", "baz")).To(matchers.Equal("foo if not exists")) + }) } diff --git a/go.mod b/go.mod index 587349c0..8999844b 100644 --- a/go.mod +++ b/go.mod @@ -2,32 +2,25 @@ module github.com/go-gorp/gorp/v3 go 1.18 -retract ( - // Versions prior to 3.0.4 had a vulnerability in the dependency graph. While we don't - // directly use yaml, I'm not comfortable encouraging people to use versions with a - // CVE - so prior versions are retracted. - // - // See CVE-2019-11254 - [v3.0.0, v3.0.3] -) +// Versions prior to 3.0.4 had a vulnerability in the dependency graph. While we don't +// directly use yaml, I'm not comfortable encouraging people to use versions with a +// CVE - so prior versions are retracted. +// +// See CVE-2019-11254 +retract [v3.0.0, v3.0.3] require ( github.com/go-sql-driver/mysql v1.6.0 github.com/lib/pq v1.10.7 github.com/mattn/go-sqlite3 v1.14.15 - github.com/poy/onpar v1.1.2 + github.com/poy/onpar v0.3.2 github.com/stretchr/testify v1.8.0 ) require ( github.com/davecgh/go-spew v1.1.1 // indirect - github.com/fatih/color v1.13.0 // indirect github.com/kr/pretty v0.3.1 // indirect - github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.16 // indirect - github.com/nelsam/hel/v2 v2.3.3 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - golang.org/x/sys v0.0.0-20221013171732-95e765b1cc43 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index b897e3e1..ebe4ac19 100644 --- a/go.sum +++ b/go.sum @@ -1,59 +1,10 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/a8m/expect v1.0.0/go.mod h1:4IwSCMumY49ScypDnjNbYEjgVeqy1/U2cEs3Lat96eA= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +git.sr.ht/~nelsam/hel v0.4.3 h1:9W0zz8zv8CZhFsp8r9Wq6c8gFemBdtMurjZU/JKfvfM= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= -github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= -github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= @@ -63,132 +14,23 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= -github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= -github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-sqlite3 v1.14.15 h1:vfoHhTN1af61xCRSWzFIWzx2YskyMTwHLrExkBOjvxI= github.com/mattn/go-sqlite3 v1.14.15/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/nelsam/hel/v2 v2.3.2/go.mod h1:1ZTGfU2PFTOd5mx22i5O0Lc2GY933lQ2wb/ggy+rL3w= -github.com/nelsam/hel/v2 v2.3.3 h1:Z3TAKd9JS3BoKi6fW+d1bKD2Mf0FzTqDUEAwLWzYPRQ= -github.com/nelsam/hel/v2 v2.3.3/go.mod h1:1ZTGfU2PFTOd5mx22i5O0Lc2GY933lQ2wb/ggy+rL3w= -github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/poy/onpar v0.0.0-20200406201722-06f95a1c68e8/go.mod h1:nSbFQvMj97ZyhFRSJYtut+msi4sOY6zJDGCdSc+/rZU= -github.com/poy/onpar v1.1.2 h1:QaNrNiZx0+Nar5dLgTVp5mXkyoVFIbepjyEoGSnhbAY= -github.com/poy/onpar v1.1.2/go.mod h1:6X8FLNoxyr9kkmnlqpK6LSoiOtrO6MICtWwEuWkLjzg= -github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/poy/onpar v0.3.2 h1:yo8ZRqU3C4RlvkXPWUWfonQiTodAgpKQZ1g8VTNU9xU= +github.com/poy/onpar v0.3.2/go.mod h1:6XDWG8DJ1HsFX6/Btn0pHl3Jz5d1SEEGNZ5N1gtYo+I= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v0.0.6/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= -github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20221013171732-95e765b1cc43 h1:OK7RB6t2WQX54srQQYSXMW8dF5C6/8+oA/s5QBmmto4= -golang.org/x/sys v0.0.0-20221013171732-95e765b1cc43/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200313205530-4303120df7d8/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=