Chore: format code

This commit is contained in:
loyalsoldier
2021-05-18 23:16:04 +08:00
parent 8f9eccefe9
commit 2b7401109f
33 changed files with 51 additions and 76 deletions

View File

@@ -24,10 +24,10 @@ import (
)
const (
initError = "init err"
setError = "set Error"
checkError = "check err"
getError = "get err"
initError = "init err"
setError = "set Error"
checkError = "check err"
getError = "get err"
getMultiError = "GetMulti Error"
)
@@ -100,7 +100,6 @@ func TestCache(t *testing.T) {
assert.Equal(t, 2, len(vv))
assert.Equal(t, "author", vv[0])
assert.Equal(t, "author1", vv[1])

View File

@@ -27,10 +27,10 @@ import (
)
const (
initError = "init err"
setError = "set Error"
checkError = "check err"
getError = "get err"
initError = "init err"
setError = "set Error"
checkError = "check err"
getError = "get err"
getMultiError = "GetMulti Error"
)
@@ -72,7 +72,7 @@ func TestMemcacheCache(t *testing.T) {
assert.Nil(t, bm.Delete("astaxie"))
assert.False(t, bm.IsExist("astaxie"))
assert.False(t, bm.IsExist("astaxie"))
assert.Nil(t, bm.Put("astaxie", "author", timeoutDuration))

View File

@@ -27,10 +27,10 @@ import (
)
const (
initError = "init err"
setError = "set Error"
checkError = "check err"
getError = "get err"
initError = "init err"
setError = "set Error"
checkError = "check err"
getError = "get err"
getMultiError = "GetMulti Error"
)
@@ -52,7 +52,7 @@ func TestRedisCache(t *testing.T) {
assert.False(t, bm.IsExist("astaxie"))
assert.Nil(t, bm.Put("astaxie", 1, timeoutDuration))
assert.Nil(t, bm.Put("astaxie", 1, timeoutDuration))
v, err := redis.Int(bm.Get("astaxie"), err)
assert.Nil(t, err)

View File

@@ -13,10 +13,10 @@ import (
)
const (
initError = "init err"
setError = "set Error"
checkError = "check err"
getError = "get err"
initError = "init err"
setError = "set Error"
checkError = "check err"
getError = "get err"
getMultiError = "GetMulti Error"
)
@@ -70,7 +70,7 @@ func TestSsdbcacheCache(t *testing.T) {
// test GetMulti done
assert.Nil(t, ssdb.Put("ssdb1", "ssdb1", -10*time.Second))
assert.True(t, ssdb.IsExist("ssdb1") )
assert.True(t, ssdb.IsExist("ssdb1"))
vv := ssdb.GetMulti([]string{"ssdb", "ssdb1"})
assert.Equal(t, 2, len(vv))

View File

@@ -185,7 +185,7 @@ func TestJson(t *testing.T) {
m, ok := db.(map[string]interface{})
assert.True(t, ok)
assert.Equal(t,"host" , m["host"])
assert.Equal(t, "host", m["host"])
_, err = jsonconf.Int("unknown")
assert.NotNil(t, err)

View File

@@ -23,9 +23,8 @@ import (
"github.com/beego/beego/v2/adapter/context"
)
// Demo is used to test, it's empty
func Demo(i int) {
func Demo(i int) {
}

View File

@@ -48,7 +48,7 @@ func TestCookie(t *testing.T) {
t.Fatal("get username error")
}
sess.SessionRelease(w)
if cookiestr := w.Header().Get(setCookieKey); cookiestr == "" {
t.Fatal("setcookie error")
} else {

View File

@@ -198,7 +198,6 @@ func TestMapGet(t *testing.T) {
assert.Nil(t, err)
assert.Equal(t, int64(2), res)
res, err = MapGet(m1, 1)
assert.Nil(t, err)
assert.Equal(t, int64(2), res)