diff --git a/README.md b/README.md index 66abc883..8ec7ecfc 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,8 @@ Beego is compos of four parts: 3. Client: including ORM module, httplib module, cache module; 4. Server: including web module. We will support gRPC in the future; +**Please use RELEASE version, or master branch which contains the latest bug fix** + ## Quick Start [Officail website](http://beego.me) diff --git a/client/cache/ssdb/ssdb_test.go b/client/cache/ssdb/ssdb_test.go index bdca1902..e08ed573 100644 --- a/client/cache/ssdb/ssdb_test.go +++ b/client/cache/ssdb/ssdb_test.go @@ -60,7 +60,7 @@ func TestSsdbcacheCache(t *testing.T) { assert.Equal(t, 3, v) assert.Nil(t, err) - assert.NotNil(t, ssdb.Delete(context.Background(), "ssdb")) + assert.Nil(t, ssdb.Delete(context.Background(), "ssdb")) assert.Nil(t, ssdb.Put(context.Background(), "ssdb", "ssdb", -10*time.Second)) // test string diff --git a/core/logs/log_msg.go b/core/logs/log_msg.go index f96fa72f..f1a0b559 100644 --- a/core/logs/log_msg.go +++ b/core/logs/log_msg.go @@ -37,7 +37,7 @@ func (lm *LogMsg) OldStyleFormat() string { msg := lm.Msg if len(lm.Args) > 0 { - lm.Msg = fmt.Sprintf(lm.Msg, lm.Args...) + msg = fmt.Sprintf(lm.Msg, lm.Args...) } msg = lm.Prefix + " " + msg diff --git a/core/logs/log_msg_test.go b/core/logs/log_msg_test.go index f213ed42..dcc7e7d4 100644 --- a/core/logs/log_msg_test.go +++ b/core/logs/log_msg_test.go @@ -41,4 +41,8 @@ func TestLogMsg_OldStyleFormat(t *testing.T) { res = lg.OldStyleFormat() assert.Equal(t, "[D] [/user/home/main.go:13] Cus Hello, world", res) + + lg.Msg = "hello, %s" + lg.Args = []interface{}{"world"} + assert.Equal(t, "[D] [/user/home/main.go:13] Cus hello, world", lg.OldStyleFormat()) } diff --git a/core/logs/log_test.go b/core/logs/log_test.go index 66f59108..d7728c76 100644 --- a/core/logs/log_test.go +++ b/core/logs/log_test.go @@ -18,9 +18,10 @@ import ( "testing" "github.com/stretchr/testify/assert" + ) -func TestBeeLogger_DelLogger(t *testing.T) { +func TestBeeLoggerDelLogger(t *testing.T) { prefix := "My-Cus" l := GetLogger(prefix) assert.NotNil(t, l)