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
master
Fyn 3 years ago committed by GitHub
parent 86d01e2e99
commit cf7c7cb392
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -33,7 +33,7 @@ const (
)
const (
jsonEncodingType = iota
jsonEncodingType uint32 = iota
plainEncodingType
jsonEncoding = "json"
@ -137,9 +137,9 @@ func SetUp(c LogConf) error {
}
switch c.Encoding {
case plainEncoding:
encoding = plainEncodingType
setEncoding(plainEncodingType)
default:
encoding = jsonEncodingType
setEncoding(jsonEncodingType)
}
switch c.Mode {
@ -666,3 +666,7 @@ func (lw logWriter) Write(data []byte) (int, error) {
lw.logger.Print(string(data))
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) {
old := encoding
encoding = plainEncodingType
setEncoding(jsonEncodingType)
defer func() {
encoding = old
setEncoding(old)
}()
var buf mockWriter

@ -12,6 +12,6 @@ require (
github.com/stretchr/testify v1.7.0
github.com/urfave/cli v1.22.5
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
)

Loading…
Cancel
Save