format code

This commit is contained in:
Ming Deng
2020-12-14 12:22:44 +08:00
parent 181a5b6ef6
commit d4da82ef77
51 changed files with 174 additions and 183 deletions

View File

@@ -26,7 +26,7 @@ func TestCacheIncr(t *testing.T) {
if err != nil {
t.Error("init err")
}
//timeoutDuration := 10 * time.Second
// timeoutDuration := 10 * time.Second
bm.Put("edwardhey", 0, time.Second*20)
wg := sync.WaitGroup{}
@@ -90,7 +90,7 @@ func TestCache(t *testing.T) {
t.Error("delete err")
}
//test GetMulti
// test GetMulti
if err = bm.Put("astaxie", "author", timeoutDuration); err != nil {
t.Error("set Error", err)
}
@@ -157,7 +157,7 @@ func TestFileCache(t *testing.T) {
t.Error("delete err")
}
//test string
// test string
if err = bm.Put("astaxie", "author", timeoutDuration); err != nil {
t.Error("set Error", err)
}
@@ -168,7 +168,7 @@ func TestFileCache(t *testing.T) {
t.Error("get err")
}
//test GetMulti
// test GetMulti
if err = bm.Put("astaxie1", "author1", timeoutDuration); err != nil {
t.Error("set Error", err)
}

View File

@@ -76,7 +76,7 @@ func TestRedisCache(t *testing.T) {
t.Error("delete err")
}
//test string
// test string
if err = bm.Put("astaxie", "author", timeoutDuration); err != nil {
t.Error("set Error", err)
}
@@ -88,7 +88,7 @@ func TestRedisCache(t *testing.T) {
t.Error("get err")
}
//test GetMulti
// test GetMulti
if err = bm.Put("astaxie1", "author1", timeoutDuration); err != nil {
t.Error("set Error", err)
}

View File

@@ -26,7 +26,7 @@ func TestSsdbcacheCache(t *testing.T) {
t.Error("check err")
}
timeoutDuration := 10 * time.Second
//timeoutDuration := -10*time.Second if timeoutDuration is negtive,it means permanent
// timeoutDuration := -10*time.Second if timeoutDuration is negtive,it means permanent
if err = ssdb.Put("ssdb", "ssdb", timeoutDuration); err != nil {
t.Error("set Error", err)
}
@@ -43,7 +43,7 @@ func TestSsdbcacheCache(t *testing.T) {
t.Error("get Error")
}
//inc/dec test done
// inc/dec test done
if err = ssdb.Put("ssdb", "2", timeoutDuration); err != nil {
t.Error("set Error", err)
}
@@ -72,7 +72,7 @@ func TestSsdbcacheCache(t *testing.T) {
}
}
//test string
// test string
if err = ssdb.Put("ssdb", "ssdb", -10*time.Second); err != nil {
t.Error("set Error", err)
}
@@ -83,7 +83,7 @@ func TestSsdbcacheCache(t *testing.T) {
t.Error("get err")
}
//test GetMulti done
// test GetMulti done
if err = ssdb.Put("ssdb1", "ssdb1", -10*time.Second); err != nil {
t.Error("set Error", err)
}

View File

@@ -25,7 +25,7 @@ import (
func TestXML(t *testing.T) {
var (
//xml parse should incluce in <config></config> tags
// xml parse should incluce in <config></config> tags
xmlcontext = `<?xml version="1.0" encoding="UTF-8"?>
<config>
<appname>beeapi</appname>

View File

@@ -212,7 +212,7 @@ func (c *Controller) ServeFormatted(encoding ...bool) {
// Input returns the input data map from POST or PUT request body and query string.
func (c *Controller) Input() url.Values {
val, _ := (*web.Controller)(c).Input()
val, _ := (*web.Controller)(c).Input()
return val
}

View File

@@ -19,10 +19,11 @@ import (
"net/http/httptest"
"testing"
"github.com/casbin/casbin"
beego "github.com/beego/beego/v2/adapter"
"github.com/beego/beego/v2/adapter/context"
"github.com/beego/beego/v2/adapter/plugins/auth"
"github.com/casbin/casbin"
)
func testRequest(t *testing.T, handler *beego.ControllerRegister, user string, path string, method string, code int) {