From 99fcbc35f39f5d3e6d1477944f14d8c5ef4389da Mon Sep 17 00:00:00 2001 From: Atsushi Ishibashi Date: Fri, 4 May 2018 01:45:14 +0900 Subject: [PATCH] Fix custom type assignment --- go/base/context.go | 12 ++++++------ go/binlog/binlog_dml_event.go | 9 +++++---- go/sql/builder.go | 10 +++++----- go/sql/types.go | 14 +++++++------- 4 files changed, 23 insertions(+), 22 deletions(-) diff --git a/go/base/context.go b/go/base/context.go index 69cb7dd..94039e3 100644 --- a/go/base/context.go +++ b/go/base/context.go @@ -28,23 +28,23 @@ type RowsEstimateMethod string const ( TableStatusRowsEstimate RowsEstimateMethod = "TableStatusRowsEstimate" - ExplainRowsEstimate = "ExplainRowsEstimate" - CountRowsEstimate = "CountRowsEstimate" + ExplainRowsEstimate RowsEstimateMethod = "ExplainRowsEstimate" + CountRowsEstimate RowsEstimateMethod = "CountRowsEstimate" ) type CutOver int const ( - CutOverAtomic CutOver = iota - CutOverTwoStep = iota + CutOverAtomic CutOver = iota + CutOverTwoStep ) type ThrottleReasonHint string const ( NoThrottleReasonHint ThrottleReasonHint = "NoThrottleReasonHint" - UserCommandThrottleReasonHint = "UserCommandThrottleReasonHint" - LeavingHibernationThrottleReasonHint = "LeavingHibernationThrottleReasonHint" + UserCommandThrottleReasonHint ThrottleReasonHint = "UserCommandThrottleReasonHint" + LeavingHibernationThrottleReasonHint ThrottleReasonHint = "LeavingHibernationThrottleReasonHint" ) const ( diff --git a/go/binlog/binlog_dml_event.go b/go/binlog/binlog_dml_event.go index 4fab87a..2c7aa36 100644 --- a/go/binlog/binlog_dml_event.go +++ b/go/binlog/binlog_dml_event.go @@ -7,17 +7,18 @@ package binlog import ( "fmt" - "github.com/github/gh-ost/go/sql" "strings" + + "github.com/github/gh-ost/go/sql" ) type EventDML string const ( NotDML EventDML = "NoDML" - InsertDML = "Insert" - UpdateDML = "Update" - DeleteDML = "Delete" + InsertDML EventDML = "Insert" + UpdateDML EventDML = "Update" + DeleteDML EventDML = "Delete" ) func ToEventDML(description string) EventDML { diff --git a/go/sql/builder.go b/go/sql/builder.go index 251a874..c3a6229 100644 --- a/go/sql/builder.go +++ b/go/sql/builder.go @@ -15,11 +15,11 @@ type ValueComparisonSign string const ( LessThanComparisonSign ValueComparisonSign = "<" - LessThanOrEqualsComparisonSign = "<=" - EqualsComparisonSign = "=" - GreaterThanOrEqualsComparisonSign = ">=" - GreaterThanComparisonSign = ">" - NotEqualsComparisonSign = "!=" + LessThanOrEqualsComparisonSign ValueComparisonSign = "<=" + EqualsComparisonSign ValueComparisonSign = "=" + GreaterThanOrEqualsComparisonSign ValueComparisonSign = ">=" + GreaterThanComparisonSign ValueComparisonSign = ">" + NotEqualsComparisonSign ValueComparisonSign = "!=" ) // EscapeName will escape a db/table/column/... name by wrapping with backticks. diff --git a/go/sql/types.go b/go/sql/types.go index 9c7a660..ef83819 100644 --- a/go/sql/types.go +++ b/go/sql/types.go @@ -15,13 +15,13 @@ import ( type ColumnType int const ( - UnknownColumnType ColumnType = iota - TimestampColumnType = iota - DateTimeColumnType = iota - EnumColumnType = iota - MediumIntColumnType = iota - JSONColumnType = iota - FloatColumnType = iota + UnknownColumnType ColumnType = iota + TimestampColumnType + DateTimeColumnType + EnumColumnType + MediumIntColumnType + JSONColumnType + FloatColumnType ) const maxMediumintUnsigned int32 = 16777215