build: update goctl dependency ddl-parser to v1.0.3 (#1586)
* build: update goctl dependency ddl-parser to v1.0.3 * fix: race condition when testing logx Resolves: #1587
This commit is contained in:
@@ -33,7 +33,7 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
jsonEncodingType = iota
|
jsonEncodingType uint32 = iota
|
||||||
plainEncodingType
|
plainEncodingType
|
||||||
|
|
||||||
jsonEncoding = "json"
|
jsonEncoding = "json"
|
||||||
@@ -137,9 +137,9 @@ func SetUp(c LogConf) error {
|
|||||||
}
|
}
|
||||||
switch c.Encoding {
|
switch c.Encoding {
|
||||||
case plainEncoding:
|
case plainEncoding:
|
||||||
encoding = plainEncodingType
|
setEncoding(plainEncodingType)
|
||||||
default:
|
default:
|
||||||
encoding = jsonEncodingType
|
setEncoding(jsonEncodingType)
|
||||||
}
|
}
|
||||||
|
|
||||||
switch c.Mode {
|
switch c.Mode {
|
||||||
@@ -666,3 +666,7 @@ func (lw logWriter) Write(data []byte) (int, error) {
|
|||||||
lw.logger.Print(string(data))
|
lw.logger.Print(string(data))
|
||||||
return len(data), nil
|
return len(data), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func setEncoding(encodingType uint32) {
|
||||||
|
atomic.StoreUint32(&encoding, encodingType)
|
||||||
|
}
|
||||||
|
|||||||
@@ -84,9 +84,9 @@ func TestTraceInfo(t *testing.T) {
|
|||||||
|
|
||||||
func TestTraceInfoConsole(t *testing.T) {
|
func TestTraceInfoConsole(t *testing.T) {
|
||||||
old := encoding
|
old := encoding
|
||||||
encoding = plainEncodingType
|
setEncoding(jsonEncodingType)
|
||||||
defer func() {
|
defer func() {
|
||||||
encoding = old
|
setEncoding(old)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
var buf mockWriter
|
var buf mockWriter
|
||||||
|
|||||||
@@ -12,6 +12,6 @@ require (
|
|||||||
github.com/stretchr/testify v1.7.0
|
github.com/stretchr/testify v1.7.0
|
||||||
github.com/urfave/cli v1.22.5
|
github.com/urfave/cli v1.22.5
|
||||||
github.com/zeromicro/antlr v0.0.1
|
github.com/zeromicro/antlr v0.0.1
|
||||||
github.com/zeromicro/ddl-parser v1.0.2
|
github.com/zeromicro/ddl-parser v1.0.3
|
||||||
github.com/zeromicro/go-zero v1.3.0
|
github.com/zeromicro/go-zero v1.3.0
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user