Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ jobs:
with:
go-version: stable
- name: golangci-lint
uses: golangci/golangci-lint-action@v7
uses: golangci/golangci-lint-action@v8
with:
version: latest
args: --timeout=3m
Expand Down
2 changes: 1 addition & 1 deletion canal/expr.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (ve *valueExpr) GetString() string { return ""
func (ve *valueExpr) GetProjectionOffset() int { return 0 }
func (ve *valueExpr) SetProjectionOffset(offset int) {}
func (ve *valueExpr) Restore(ctx *format.RestoreCtx) error { return nil }
func (ve *valueExpr) Accept(v ast.Visitor) (node ast.Node, ok bool) { return }
func (ve *valueExpr) Accept(v ast.Visitor) (node ast.Node, ok bool) { return node, ok }
func (ve *valueExpr) Text() string { return "" }
func (ve *valueExpr) SetText(enc charset.Encoding, text string) {}
func (ve *valueExpr) Format(w io.Writer) {}
2 changes: 1 addition & 1 deletion canal/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ func (c *Canal) updateTable(header *replication.EventHeader, db, table string) (
if err = c.eventHandler.OnTableChanged(header, db, table); err != nil && errors.Cause(err) != schema.ErrTableNotExist {
return errors.Trace(err)
}
return
return err
}

func (c *Canal) updateReplicationDelay(ev *replication.BinlogEvent) {
Expand Down
4 changes: 2 additions & 2 deletions client/resp.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ func (c *Conn) readUntilEOF() (err error) {
for {
data, err = c.ReadPacket()
if err != nil {
return
return err
}

// EOF Packet
if c.isEOFPacket(data) {
return
return err
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion mysql/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,5 @@ func ErrorCode(errMsg string) (code int) {
var tmpStr string
// golang scanf doesn't support %*,so I used a temporary variable
_, _ = fmt.Sscanf(errMsg, "%s%d", &tmpStr, &code)
return
return code
}
4 changes: 2 additions & 2 deletions mysql/mysql_gtid.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ func parseInterval(str string) (i Interval, err error) {
}

if err != nil {
return
return i, err
}

if i.Stop <= i.Start {
err = errors.Errorf("invalid interval format, must n[-n] and the end must >= start")
}

return
return i, err
}

func (i Interval) String() string {
Expand Down
2 changes: 1 addition & 1 deletion mysql/resultset_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func fieldType(value interface{}) (typ uint8, err error) {
default:
err = errors.Errorf("unsupport type %T for resultset", value)
}
return
return typ, err
}

func formatField(field *Field, value interface{}) error {
Expand Down
4 changes: 2 additions & 2 deletions replication/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,10 @@ func decodeSid(data []byte) (format GtidFormat, sidnr uint64) {
masked := make([]byte, 8)
copy(masked, data[1:7])
sidnr = binary.LittleEndian.Uint64(masked)
return
return format, sidnr
}
sidnr = binary.LittleEndian.Uint64(data[:8])
return
return format, sidnr
}

func (e *PreviousGTIDsEvent) Decode(data []byte) error {
Expand Down
23 changes: 11 additions & 12 deletions replication/row_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,18 +344,18 @@ func (e *TableMapEvent) decodeIntSeq(v []byte) (ret []uint64, err error) {
p += n
ret = append(ret, i)
}
return
return ret, err
}

func (e *TableMapEvent) decodeDefaultCharset(v []byte) (ret []uint64, err error) {
ret, err = e.decodeIntSeq(v)
if err != nil {
return
return ret, err
}
if len(ret)%2 != 1 {
return nil, errors.Errorf("Expect odd item in DefaultCharset but got %d", len(ret))
}
return
return ret, err
}

func (e *TableMapEvent) decodeColumnNames(v []byte) error {
Expand Down Expand Up @@ -390,7 +390,7 @@ func (e *TableMapEvent) decodeStrValue(v []byte) (ret [][][]byte, err error) {
}
ret = append(ret, vals)
}
return
return ret, err
}

func (e *TableMapEvent) decodeSimplePrimaryKey(v []byte) error {
Expand Down Expand Up @@ -561,7 +561,7 @@ func (e *TableMapEvent) Dump(w io.Writer) {
// i must be in range [0, ColumnCount).
func (e *TableMapEvent) Nullable(i int) (available, nullable bool) {
if len(e.NullBitmap) == 0 {
return
return available, nullable
}
return true, e.NullBitmap[i/8]&(1<<uint(i%8)) != 0
}
Expand Down Expand Up @@ -1082,8 +1082,7 @@ func (e *RowsEvent) DecodeData(pos int, data []byte) (err2 error) {
if e.compressed {
data, err2 = mysql.DecompressMariadbData(data[pos:])
if err2 != nil {
//nolint:nakedret
return
return err2
}
pos = 0
}
Expand Down Expand Up @@ -1481,7 +1480,7 @@ func decodeString(data []byte, length int) (v string, n int) {
v = utils.ByteSliceToString(data[2:n])
}

return
return v, n
}

// ref: https://github.com/mysql/mysql-server/blob/a9b0c712de3509d8d08d3ba385d41a4df6348775/strings/decimal.c#L137
Expand All @@ -1502,7 +1501,7 @@ func decodeDecimalDecompressValue(compIndx int, data []byte, mask uint8) (size i
case 4:
value = uint32(data[3]^mask) | uint32(data[2]^mask)<<8 | uint32(data[1]^mask)<<16 | uint32(data[0]^mask)<<24
}
return
return size, value
}

var zeros = [digitsPerInteger]byte{48, 48, 48, 48, 48, 48, 48, 48, 48}
Expand Down Expand Up @@ -1625,7 +1624,7 @@ func decodeBit(data []byte, nbits int, length int) (value int64, err error) {
value = int64(data[0])
}
}
return
return value, err
}

func littleDecodeBit(data []byte, nbits int, length int) (value int64, err error) {
Expand Down Expand Up @@ -1657,7 +1656,7 @@ func littleDecodeBit(data []byte, nbits int, length int) (value int64, err error
value = int64(data[0])
}
}
return
return value, err
}

func decodeTimestamp2(data []byte, dec uint16, timestampStringLocation *time.Location) (interface{}, int, error) {
Expand Down Expand Up @@ -1859,7 +1858,7 @@ func decodeBlob(data []byte, meta uint16) (v []byte, n int, err error) {
err = fmt.Errorf("invalid blob packlen = %d", meta)
}

return
return v, n, err
}

func (e *RowsEvent) Dump(w io.Writer) {
Expand Down
2 changes: 1 addition & 1 deletion serialization/serialization.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (f *Format) stringParts() (parts []string) {
parts = append(parts, fmt.Sprintf(" Value: %s", f.Type.String()))
}
}
return
return parts
}

// Field represents a `message_field`
Expand Down
Loading