diff --git a/driver/driver_options_test.go b/driver/driver_options_test.go index d195e22af..3836e61d4 100644 --- a/driver/driver_options_test.go +++ b/driver/driver_options_test.go @@ -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" diff --git a/go.mod b/go.mod index 2a60d30ac..59658762e 100644 --- a/go.mod +++ b/go.mod @@ -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 ) diff --git a/go.sum b/go.sum index ba30bf4bc..f460625bf 100644 --- a/go.sum +++ b/go.sum @@ -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= diff --git a/server/conn.go b/server/conn.go index e71d9d42c..7fc80727c 100644 --- a/server/conn.go +++ b/server/conn.go @@ -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" ) @@ -35,7 +33,7 @@ type Conn struct { stmts map[uint32]*Stmt stmtID uint32 - closed sync2.AtomicBool + closed atomic.Bool } var baseConnID uint32 = 10000 @@ -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() @@ -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() @@ -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 {