Skip to content

Commit 8463e7a

Browse files
committed
lint - fix all whitespace
1 parent 4146fd7 commit 8463e7a

17 files changed

+1
-37
lines changed

canal/canal_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,8 @@ func TestDropTableExp(t *testing.T) {
297297
}
298298
}
299299
}
300-
func TestWithoutSchemeExp(t *testing.T) {
301300

301+
func TestWithoutSchemeExp(t *testing.T) {
302302
cases := []replication.QueryEvent{
303303
replication.QueryEvent{
304304
Schema: []byte("test"),

client/client_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,6 @@ func (s *clientTestSuite) TestStmt_Select(c *C) {
289289

290290
e, _ = result.GetStringByName(0, "e")
291291
c.Assert(e, Equals, "test1")
292-
293292
}
294293

295294
func (s *clientTestSuite) TestStmt_NULL(c *C) {

client/resp.go

-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ func (c *Conn) readAuthResult() ([]byte, string, error) {
173173
// see: https://insidemysql.com/preparing-your-community-connector-for-mysql-8-part-2-sha256/
174174
// packet indicator
175175
switch data[0] {
176-
177176
case OK_HEADER:
178177
_, err := c.handleOKPacket(data)
179178
return nil, "", err

client/stmt.go

-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ func (s *Stmt) write(args ...interface{}) error {
109109
paramValues[i] = []byte{1}
110110
} else {
111111
paramValues[i] = []byte{0}
112-
113112
}
114113
case float32:
115114
paramTypes[i<<1] = MYSQL_TYPE_FLOAT

cmd/go-mysqlbinlog/main.go

-1
Original file line numberDiff line numberDiff line change
@@ -77,5 +77,4 @@ func main() {
7777
e.Dump(os.Stdout)
7878
}
7979
}
80-
8180
}

dump/dump_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ e7574090-b123-11e8-8bb4-005056a29643:1-12'
194194
c.Assert(err, IsNil)
195195
c.Assert(expectedGtidset.Equal(handler.gset), IsTrue)
196196
}
197-
198197
}
199198

200199
func (s *parserTestSuite) TestParseFindTable(c *C) {

mysql/mysql_gtid.go

-2
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,6 @@ func ParseMysqlGTIDSet(str string) (GTIDSet, error) {
320320
} else {
321321
s.AddSet(set)
322322
}
323-
324323
}
325324
return s, nil
326325
}
@@ -416,7 +415,6 @@ func (s *MysqlGTIDSet) Equal(o GTIDSet) bool {
416415
}
417416

418417
return true
419-
420418
}
421419

422420
func (s *MysqlGTIDSet) String() string {

replication/backup.go

-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ func (b *BinlogSyncer) StartBackup(backupDir string, p Position, timeout time.Du
8484
if _, err = f.Write(BinLogFileHeader); err != nil {
8585
return errors.Trace(err)
8686
}
87-
8887
}
8988

9089
if n, err := f.Write(e.RawData); err != nil {

replication/binlogsyncer.go

-1
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,6 @@ func (b *BinlogSyncer) registerSlave() error {
283283
// if _, err = b.c.Execute(`SET @master_binlog_checksum=@@global.binlog_checksum`); err != nil {
284284
// return errors.Trace(err)
285285
// }
286-
287286
}
288287
}
289288

replication/event.go

-5
Original file line numberDiff line numberDiff line change
@@ -395,11 +395,9 @@ func (e *GTIDEvent) Decode(data []byte) error {
395395
e.ImmediateCommitTimestamp &= ^(uint64(1) << 55)
396396
e.OriginalCommitTimestamp = FixedLengthInt(data[pos : pos+7])
397397
pos += 7
398-
399398
} else {
400399
// Otherwise OriginalCommitTimestamp == ImmediateCommitTimestamp
401400
e.OriginalCommitTimestamp = e.ImmediateCommitTimestamp
402-
403401
}
404402

405403
// TRANSACTION_LENGTH_MIN_LENGTH = 1
@@ -423,13 +421,10 @@ func (e *GTIDEvent) Decode(data []byte) error {
423421
e.ImmediateServerVersion &= ^(uint32(1) << 31)
424422
e.OriginalServerVersion = binary.LittleEndian.Uint32(data[pos:])
425423
pos += 4
426-
427424
} else {
428425
// Otherwise OriginalServerVersion == ImmediateServerVersion
429426
e.OriginalServerVersion = e.ImmediateServerVersion
430-
431427
}
432-
433428
}
434429
}
435430
return nil

replication/event_test.go

-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ func (_ *testDecodeSuite) TestMariadbGTIDEvent(c *C) {
5050
}
5151

5252
func (_ *testDecodeSuite) TestGTIDEventMysql8NewFields(c *C) {
53-
5453
testcases := []struct {
5554
data []byte
5655
expectImmediateCommitTimestamp uint64
@@ -97,5 +96,4 @@ func (_ *testDecodeSuite) TestGTIDEventMysql8NewFields(c *C) {
9796
c.Assert(ev.ImmediateServerVersion, Equals, tc.expectImmediateServerVersion)
9897
c.Assert(ev.OriginalServerVersion, Equals, tc.expectOriginalServerVersion)
9998
}
100-
10199
}

replication/json_binary.go

-1
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,6 @@ func (d *jsonBinaryDecoder) decodeDateTime(data []byte) interface{} {
452452
frac := v % (1 << 24)
453453

454454
return fmt.Sprintf("%04d-%02d-%02d %02d:%02d:%02d.%06d", year, month, day, hour, minute, second, frac)
455-
456455
}
457456

458457
func (d *jsonBinaryDecoder) decodeCount(data []byte, isSmall bool) int {

replication/parser.go

-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ func (p *BinlogParser) parseSingleEvent(r io.Reader, onEvent OnEventFunc) (bool,
157157
}
158158

159159
func (p *BinlogParser) ParseReader(r io.Reader, onEvent OnEventFunc) error {
160-
161160
for {
162161
if atomic.LoadUint32(&p.stopProcessing) == 1 {
163162
break

replication/row_event.go

-9
Original file line numberDiff line numberDiff line change
@@ -238,10 +238,8 @@ func (e *TableMapEvent) decodeMeta(data []byte) error {
238238
}
239239

240240
func (e *TableMapEvent) decodeOptionalMeta(data []byte) (err error) {
241-
242241
pos := 0
243242
for pos < len(data) {
244-
245243
// optional metadata fields are stored in Type, Length, Value(TLV) format
246244
// Type takes 1 byte. Length is a packed integer value. Values takes Length bytes
247245
t := data[pos]
@@ -637,7 +635,6 @@ func (e *TableMapEvent) EnumSetCollationMap() map[int]uint64 {
637635
}
638636

639637
func (e *TableMapEvent) collationMap(includeType func(int) bool, defaultCharset, columnCharset []uint64) map[int]uint64 {
640-
641638
if len(defaultCharset) != 0 {
642639
defaultCollation := defaultCharset[0]
643640

@@ -666,7 +663,6 @@ func (e *TableMapEvent) collationMap(includeType func(int) bool, defaultCharset,
666663
}
667664

668665
if len(columnCharset) != 0 {
669-
670666
p := 0
671667
ret := make(map[int]uint64)
672668
for i := 0; i < int(e.ColumnCount); i++ {
@@ -739,7 +735,6 @@ func (e *TableMapEvent) GeometryTypeMap() map[int]uint64 {
739735
// Table_map_log_event::print_columns in mysql-8.0/sql/log_event.cc and mariadb-10.5/sql/log_event_client.cc
740736

741737
func (e *TableMapEvent) realType(i int) byte {
742-
743738
typ := e.ColumnType[i]
744739

745740
switch typ {
@@ -757,7 +752,6 @@ func (e *TableMapEvent) realType(i int) byte {
757752
}
758753

759754
func (e *TableMapEvent) IsNumericColumn(i int) bool {
760-
761755
switch e.realType(i) {
762756
case MYSQL_TYPE_TINY,
763757
MYSQL_TYPE_SHORT,
@@ -772,14 +766,12 @@ func (e *TableMapEvent) IsNumericColumn(i int) bool {
772766
default:
773767
return false
774768
}
775-
776769
}
777770

778771
// IsCharacterColumn returns true if the column type is considered as character type.
779772
// Note that JSON/GEOMETRY types are treated as character type in mariadb.
780773
// (JSON is an alias for LONGTEXT in mariadb: https://mariadb.com/kb/en/json-data-type/)
781774
func (e *TableMapEvent) IsCharacterColumn(i int) bool {
782-
783775
switch e.realType(i) {
784776
case MYSQL_TYPE_STRING,
785777
MYSQL_TYPE_VAR_STRING,
@@ -796,7 +788,6 @@ func (e *TableMapEvent) IsCharacterColumn(i int) bool {
796788
default:
797789
return false
798790
}
799-
800791
}
801792

802793
func (e *TableMapEvent) IsEnumColumn(i int) bool {

replication/row_event_test.go

-7
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,6 @@ func (_ *testDecodeSuite) TestTableMapOptMetaNames(c *C) {
913913
}
914914

915915
for _, tc := range testcases {
916-
917916
tableMapEvent := new(TableMapEvent)
918917
tableMapEvent.tableIDSize = 6
919918
err := tableMapEvent.Decode(tc.data)
@@ -929,7 +928,6 @@ func (_ *testDecodeSuite) TestTableMapOptMetaNames(c *C) {
929928
c.Assert(tableMapEvent.EnumStrValueString(), DeepEquals, [][]string(nil))
930929
}
931930
}
932-
933931
}
934932

935933
func (_ *testDecodeSuite) TestTableMapOptMetaPrimaryKey(c *C) {
@@ -1008,11 +1006,9 @@ func (_ *testDecodeSuite) TestTableMapOptMetaPrimaryKey(c *C) {
10081006
c.Assert(tableMapEvent.PrimaryKey, DeepEquals, tc.expectedPrimaryKey)
10091007
c.Assert(tableMapEvent.PrimaryKeyPrefix, DeepEquals, tc.expectedPrimaryKeyPrefix)
10101008
}
1011-
10121009
}
10131010

10141011
func (_ *testDecodeSuite) TestTableMapHelperMaps(c *C) {
1015-
10161012
/*
10171013
CREATE TABLE `_types` (
10181014
`b_bit` bit(64) NOT NULL DEFAULT b'0',
@@ -1175,7 +1171,6 @@ func (_ *testDecodeSuite) TestTableMapHelperMaps(c *C) {
11751171
}
11761172

11771173
for _, tc := range testcases {
1178-
11791174
tableMapEvent := new(TableMapEvent)
11801175
tableMapEvent.flavor = tc.flavor
11811176
tableMapEvent.tableIDSize = 6
@@ -1187,7 +1182,5 @@ func (_ *testDecodeSuite) TestTableMapHelperMaps(c *C) {
11871182
c.Assert(tableMapEvent.EnumStrValueMap(), DeepEquals, tc.enumStrValueMap)
11881183
c.Assert(tableMapEvent.SetStrValueMap(), DeepEquals, tc.setStrValueMap)
11891184
c.Assert(tableMapEvent.GeometryTypeMap(), DeepEquals, tc.geometryTypeMap)
1190-
11911185
}
1192-
11931186
}

schema/schema.go

-1
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,6 @@ func (ta *Table) fetchIndexes(conn mysql.Executer) error {
320320
}
321321

322322
return ta.fetchPrimaryKeyColumns()
323-
324323
}
325324

326325
func (ta *Table) fetchIndexesViaSqlDB(conn *sql.DB) error {

server/stmt.go

-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ func (c *Conn) writePrepare(s *Stmt) error {
9292
if err := c.writeEOF(); err != nil {
9393
return err
9494
}
95-
9695
}
9796
return nil
9897
}

0 commit comments

Comments
 (0)