Skip to content

Commit

Permalink
remove rest of siddontang/go dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
serprex committed Dec 15, 2024
1 parent e700be5 commit 7e624ef
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion driver/driver_options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"time"

"github.com/pingcap/errors"
"github.com/siddontang/go/log"
"github.com/siddontang/go-log/log"
"github.com/stretchr/testify/require"

"github.com/go-mysql-org/go-mysql/client"
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ require (
github.com/pingcap/errors v0.11.5-0.20240311024730-e056997136bb
github.com/pingcap/tidb/pkg/parser v0.0.0-20241118164214-4f047be191be
github.com/shopspring/decimal v1.2.0
github.com/siddontang/go v0.0.0-20180604090527-bdc77568d726
github.com/siddontang/go-log v0.0.0-20180807004314-8d05993dda07
github.com/stretchr/testify v1.8.4
)
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjR
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ=
github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
github.com/siddontang/go v0.0.0-20180604090527-bdc77568d726 h1:xT+JlYxNGqyT+XcU8iUrN18JYed2TvG9yN5ULG2jATM=
github.com/siddontang/go v0.0.0-20180604090527-bdc77568d726/go.mod h1:3yhqj7WBBfRhbBlzyOC3gUxftwsU0u8gqevxwIHQpMw=
github.com/siddontang/go-log v0.0.0-20180807004314-8d05993dda07 h1:oI+RNwuC9jF2g2lP0u0cVEEZrc/AYBCuFdvwrLWM/6Q=
github.com/siddontang/go-log v0.0.0-20180807004314-8d05993dda07/go.mod h1:yFdBgwXP24JziuRl2NMUahT7nGLNOKi1SIiFxMttVD4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
Expand Down
12 changes: 5 additions & 7 deletions server/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import (
"net"
"sync/atomic"

"github.com/siddontang/go/sync2"

. "github.com/go-mysql-org/go-mysql/mysql"
"github.com/go-mysql-org/go-mysql/packet"
)
Expand Down Expand Up @@ -35,7 +33,7 @@ type Conn struct {
stmts map[uint32]*Stmt
stmtID uint32

closed sync2.AtomicBool
closed atomic.Bool
}

var baseConnID uint32 = 10000
Expand All @@ -61,7 +59,7 @@ func NewConn(conn net.Conn, user string, password string, h Handler) (*Conn, err
stmts: make(map[uint32]*Stmt),
salt: RandomBuf(20),
}
c.closed.Set(false)
c.closed.Store(false)

if err := c.handshake(); err != nil {
c.Close()
Expand Down Expand Up @@ -89,7 +87,7 @@ func NewCustomizedConn(conn net.Conn, serverConf *Server, p CredentialProvider,
stmts: make(map[uint32]*Stmt),
salt: RandomBuf(20),
}
c.closed.Set(false)
c.closed.Store(false)

if err := c.handshake(); err != nil {
c.Close()
Expand Down Expand Up @@ -126,12 +124,12 @@ func (c *Conn) handshake() error {
}

func (c *Conn) Close() {
c.closed.Set(true)
c.closed.Store(true)
c.Conn.Close()
}

func (c *Conn) Closed() bool {
return c.closed.Get()
return c.closed.Load()
}

func (c *Conn) GetUser() string {
Expand Down

0 comments on commit 7e624ef

Please sign in to comment.