Apply goimports' modifications
This commit is contained in:
@@ -15,10 +15,11 @@
|
||||
package context
|
||||
|
||||
import (
|
||||
"github.com/beego/beego/v2/server/web/session"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
|
||||
"github.com/beego/beego/v2/server/web/session"
|
||||
)
|
||||
|
||||
func TestXsrfReset_01(t *testing.T) {
|
||||
@@ -68,4 +69,4 @@ func TestContext_Session2(t *testing.T) {
|
||||
if store, err := c.Session(); store == nil || err != nil {
|
||||
t.FailNow()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,4 +53,4 @@ func TestFilterChainBuilder_report(t *testing.T) {
|
||||
|
||||
ctx.Input.SetData("RouterPattern", "my-route")
|
||||
report(time.Second, ctx, fb.buildVec())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package session
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
"github.com/beego/beego/v2/server/web"
|
||||
webContext "github.com/beego/beego/v2/server/web/context"
|
||||
@@ -32,4 +33,4 @@ func Session(providerType session.ProviderType, options ...session.ManagerConfig
|
||||
next(ctx)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
package session
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
|
||||
"github.com/beego/beego/v2/server/web"
|
||||
webContext "github.com/beego/beego/v2/server/web/context"
|
||||
"github.com/beego/beego/v2/server/web/session"
|
||||
"github.com/google/uuid"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func testRequest(t *testing.T, handler *web.ControllerRegister, path string, method string, code int) {
|
||||
|
||||
@@ -60,7 +60,6 @@ func TestControllerRegister_InsertFilterChain_Order(t *testing.T) {
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
InsertFilterChain("/abc", func(next FilterFunc) FilterFunc {
|
||||
return func(ctx *context.Context) {
|
||||
ctx.Output.Header("second", fmt.Sprintf("%d", time.Now().UnixNano()))
|
||||
|
||||
@@ -70,7 +70,7 @@ var (
|
||||
}
|
||||
)
|
||||
|
||||
const commentFilename = "commentsRouter.go"
|
||||
const commentFilename = "commentsRouter.go"
|
||||
|
||||
func init() {
|
||||
pkgLastupdate = make(map[string]int64)
|
||||
|
||||
@@ -22,7 +22,7 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func Test_getRouterDir(t *testing.T) {
|
||||
func Test_getRouterDir(t *testing.T) {
|
||||
pkg := filepath.Dir(os.TempDir())
|
||||
|
||||
res := getRouterDir(pkg)
|
||||
|
||||
@@ -219,4 +219,4 @@ func TestManagerConfig_Opts(t *testing.T) {
|
||||
if c.EnableSetCookie != true {
|
||||
t.Error()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -342,7 +342,7 @@ func (t *Tree) match(treePattern string, pattern string, wildcardValues []string
|
||||
if runObject == nil && len(t.fixrouters) > 0 {
|
||||
// Filter the .json .xml .html extension
|
||||
for _, str := range allowSuffixExt {
|
||||
if strings.HasSuffix(seg, str) && strings.HasSuffix(treePattern, seg){
|
||||
if strings.HasSuffix(seg, str) && strings.HasSuffix(treePattern, seg) {
|
||||
for _, subTree := range t.fixrouters {
|
||||
// strings.HasSuffix(treePattern, seg) avoid cases: /aaa.html/bbb could access /aaa/bbb
|
||||
if subTree.prefix == seg[:len(seg)-len(str)] {
|
||||
|
||||
Reference in New Issue
Block a user