format code
This commit is contained in:
parent
15fa7e15d4
commit
5ade9fa025
@ -9,4 +9,4 @@ name = "go"
|
||||
enabled = true
|
||||
|
||||
[analyzers.meta]
|
||||
import_paths = ["github.com/beego/beego"]
|
||||
import_paths = ["github.com/beego/beego/v2"]
|
||||
|
||||
4
.github/linters/.golangci.yml
vendored
4
.github/linters/.golangci.yml
vendored
@ -38,6 +38,6 @@ linters:
|
||||
|
||||
linters-settings:
|
||||
gci:
|
||||
local-prefixes: github.com/beego/beego
|
||||
local-prefixes: github.com/beego
|
||||
goimports:
|
||||
local-prefixes: github.com/beego/beego
|
||||
local-prefixes: github.com/beego
|
||||
|
||||
@ -89,5 +89,3 @@ Also when filing an issue, make sure to answer these five questions:
|
||||
Please take a moment to check that an issue doesn't already exist documenting your bug report or improvement proposal.
|
||||
If it does, it never hurts to add a quick "+1" or "I have this problem too". This will help prioritize the most common
|
||||
problems and requests.
|
||||
|
||||
Also, if you don't know how to use it. please make sure you have read through the docs in http://beego.vip/docs
|
||||
|
||||
4
Makefile
4
Makefile
@ -62,3 +62,7 @@ test-orm-tidb: ## Run ORM unit tests on tidb.
|
||||
|
||||
.PHONY: test-orm-all
|
||||
test-orm-all: test-orm-mysql5 test-orm-mysql8 test-orm-pgsql test-orm-tidb
|
||||
|
||||
.PHONY: fmt
|
||||
fmt:
|
||||
goimports -local "github.com/beego/beego" -w .
|
||||
@ -86,7 +86,6 @@ Congratulations! You've just built your first **beego** app.
|
||||
|
||||
## Community
|
||||
|
||||
* [http://beego.vip/community](http://beego.vip/community)
|
||||
* Welcome to join us in Slack: [https://beego.slack.com invite](https://join.slack.com/t/beego/shared_invite/zt-fqlfjaxs-_CRmiITCSbEqQG9NeBqXKA),
|
||||
* QQ Group ID:523992905
|
||||
* [Contribution Guide](https://github.com/beego/beedoc/blob/master/en-US/intro/contributing.md).
|
||||
|
||||
1
adapter/cache/cache.go
vendored
1
adapter/cache/cache.go
vendored
@ -28,7 +28,6 @@
|
||||
// bm.IsExist("astaxie")
|
||||
// bm.Delete("astaxie")
|
||||
//
|
||||
// more docs http://beego.vip/docs/module/cache.md
|
||||
package cache
|
||||
|
||||
import (
|
||||
|
||||
1
adapter/cache/memcache/memcache.go
vendored
1
adapter/cache/memcache/memcache.go
vendored
@ -26,7 +26,6 @@
|
||||
//
|
||||
// bm, err := cache.NewCache("memcache", `{"conn":"127.0.0.1:11211"}`)
|
||||
//
|
||||
// more docs http://beego.vip/docs/module/cache.md
|
||||
package memcache
|
||||
|
||||
import (
|
||||
|
||||
1
adapter/cache/redis/redis.go
vendored
1
adapter/cache/redis/redis.go
vendored
@ -26,7 +26,6 @@
|
||||
//
|
||||
// bm, err := cache.NewCache("redis", `{"conn":"127.0.0.1:11211"}`)
|
||||
//
|
||||
// more docs http://beego.vip/docs/module/cache.md
|
||||
package redis
|
||||
|
||||
import (
|
||||
|
||||
@ -37,7 +37,6 @@
|
||||
// cnf.DIY(key string) (interface{}, error)
|
||||
// cnf.GetSection(section string) (map[string]string, error)
|
||||
// cnf.SaveConfigFile(filename string) error
|
||||
// More docs http://beego.vip/docs/module/config.md
|
||||
package config
|
||||
|
||||
import (
|
||||
|
||||
@ -26,7 +26,6 @@
|
||||
//
|
||||
// cnf, err := config.NewConfig("xml", "config.xml")
|
||||
//
|
||||
// More docs http://beego.vip/docs/module/config.md
|
||||
package xml
|
||||
|
||||
import (
|
||||
|
||||
@ -26,7 +26,6 @@
|
||||
//
|
||||
// cnf, err := config.NewConfig("yaml", "config.yaml")
|
||||
//
|
||||
// More docs http://beego.vip/docs/module/config.md
|
||||
package yaml
|
||||
|
||||
import (
|
||||
|
||||
@ -19,7 +19,6 @@
|
||||
//
|
||||
// ctx := context.Context{Request:req,ResponseWriter:rw}
|
||||
//
|
||||
// more docs http://beego.vip/docs/module/context.md
|
||||
package context
|
||||
|
||||
import (
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
// }
|
||||
// fmt.Println(str)
|
||||
//
|
||||
// more docs http://beego.vip/docs/module/httplib.md
|
||||
package httplib
|
||||
|
||||
import (
|
||||
|
||||
@ -30,7 +30,6 @@
|
||||
// log.Debug("debug")
|
||||
// log.Critical("critical")
|
||||
//
|
||||
// more docs http://beego.vip/docs/module/logs.md
|
||||
package logs
|
||||
|
||||
import (
|
||||
|
||||
@ -15,8 +15,6 @@
|
||||
package logs
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
)
|
||||
|
||||
@ -40,30 +38,6 @@ func (o *oldToNewAdapter) Flush() {
|
||||
o.old.Flush()
|
||||
}
|
||||
|
||||
func (o *oldToNewAdapter) SetFormatter(f logs.LogFormatter) {
|
||||
func (*oldToNewAdapter) SetFormatter(f logs.LogFormatter) {
|
||||
panic("unsupported operation, you should not invoke this method")
|
||||
}
|
||||
|
||||
type newToOldAdapter struct {
|
||||
n logs.Logger
|
||||
}
|
||||
|
||||
func (n *newToOldAdapter) Init(config string) error {
|
||||
return n.n.Init(config)
|
||||
}
|
||||
|
||||
func (n *newToOldAdapter) WriteMsg(when time.Time, msg string, level int) error {
|
||||
return n.n.WriteMsg(&logs.LogMsg{
|
||||
When: when,
|
||||
Msg: msg,
|
||||
Level: level,
|
||||
})
|
||||
}
|
||||
|
||||
func (n *newToOldAdapter) Destroy() {
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (n *newToOldAdapter) Flush() {
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
@ -51,7 +51,6 @@
|
||||
// num, err = o.Delete(&u)
|
||||
// }
|
||||
//
|
||||
// more docs: http://beego.vip/docs/mvc/model/overview.md
|
||||
package orm
|
||||
|
||||
import (
|
||||
|
||||
@ -29,7 +29,6 @@
|
||||
// go globalSessions.GC()
|
||||
// }
|
||||
//
|
||||
// more docs: http://beego.vip/docs/module/session.md
|
||||
package couchbase
|
||||
|
||||
import (
|
||||
|
||||
@ -29,7 +29,6 @@
|
||||
// go globalSessions.GC()
|
||||
// }
|
||||
//
|
||||
// more docs: http://beego.vip/docs/module/session.md
|
||||
package memcache
|
||||
|
||||
import (
|
||||
|
||||
@ -37,14 +37,12 @@
|
||||
// go globalSessions.GC()
|
||||
// }
|
||||
//
|
||||
// more docs: http://beego.vip/docs/module/session.md
|
||||
package mysql
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
||||
// import mysql driver
|
||||
_ "github.com/go-sql-driver/mysql"
|
||||
|
||||
"github.com/beego/beego/v2/adapter/session"
|
||||
|
||||
@ -47,14 +47,12 @@
|
||||
// go globalSessions.GC()
|
||||
// }
|
||||
//
|
||||
// more docs: http://beego.vip/docs/module/session.md
|
||||
package postgres
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
||||
// import postgresql Driver
|
||||
_ "github.com/lib/pq"
|
||||
|
||||
"github.com/beego/beego/v2/adapter/session"
|
||||
|
||||
@ -29,7 +29,6 @@
|
||||
// go globalSessions.GC()
|
||||
// }
|
||||
//
|
||||
// more docs: http://beego.vip/docs/module/session.md
|
||||
package redis
|
||||
|
||||
import (
|
||||
|
||||
@ -29,7 +29,6 @@
|
||||
// go globalSessions.GC()
|
||||
// }
|
||||
//
|
||||
// more docs: http://beego.vip/docs/module/session.md
|
||||
package redis_cluster
|
||||
|
||||
import (
|
||||
|
||||
@ -24,7 +24,6 @@
|
||||
// go globalSessions.GC()
|
||||
// }
|
||||
//
|
||||
// more docs: http://beego.vip/docs/module/session.md
|
||||
package session
|
||||
|
||||
import (
|
||||
|
||||
@ -106,7 +106,6 @@ func Htmlunquote(text string) string {
|
||||
// /login?next=/
|
||||
// /user/John%20Doe
|
||||
//
|
||||
// more detail http://beego.vip/docs/mvc/controller/urlbuilding.md
|
||||
func URLFor(endpoint string, values ...interface{}) string {
|
||||
return web.URLFor(endpoint, values...)
|
||||
}
|
||||
|
||||
@ -27,7 +27,6 @@
|
||||
//
|
||||
// AddHealthCheck("database",&DatabaseCheck{})
|
||||
//
|
||||
// more docs: http://beego.vip/docs/module/toolbox.md
|
||||
package toolbox
|
||||
|
||||
import (
|
||||
|
||||
@ -237,6 +237,7 @@ func (ms *MapSorter) Sort() {
|
||||
}
|
||||
|
||||
func (ms *MapSorter) Len() int { return len(ms.Keys) }
|
||||
|
||||
func (ms *MapSorter) Less(i, j int) bool {
|
||||
if ms.Vals[i].GetNext(context.Background()).IsZero() {
|
||||
return false
|
||||
|
||||
@ -50,9 +50,5 @@ In your view templates:
|
||||
</ul>
|
||||
{{end}}
|
||||
|
||||
See also
|
||||
|
||||
http://beego.vip/docs/mvc/view/page.md
|
||||
|
||||
*/
|
||||
package pagination
|
||||
|
||||
@ -43,7 +43,6 @@
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// more info: http://beego.vip/docs/mvc/controller/validation.md
|
||||
package validation
|
||||
|
||||
import (
|
||||
|
||||
1
client/cache/cache.go
vendored
1
client/cache/cache.go
vendored
@ -28,7 +28,6 @@
|
||||
// bm.IsExist("astaxie")
|
||||
// bm.Delete("astaxie")
|
||||
//
|
||||
// more docs http://beego.vip/docs/module/cache.md
|
||||
package cache
|
||||
|
||||
import (
|
||||
|
||||
1
client/cache/memcache/memcache.go
vendored
1
client/cache/memcache/memcache.go
vendored
@ -26,7 +26,6 @@
|
||||
//
|
||||
// bm, err := cache.NewCache("memcache", `{"conn":"127.0.0.1:11211"}`)
|
||||
//
|
||||
// more docs http://beego.vip/docs/module/cache.md
|
||||
package memcache
|
||||
|
||||
import (
|
||||
|
||||
3
client/cache/memcache/memcache_test.go
vendored
3
client/cache/memcache/memcache_test.go
vendored
@ -24,12 +24,11 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/beego/beego/v2/core/berror"
|
||||
|
||||
_ "github.com/bradfitz/gomemcache/memcache"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/beego/beego/v2/client/cache"
|
||||
"github.com/beego/beego/v2/core/berror"
|
||||
)
|
||||
|
||||
func TestMemcacheCache(t *testing.T) {
|
||||
|
||||
3
client/cache/read_through_test.go
vendored
3
client/cache/read_through_test.go
vendored
@ -20,8 +20,9 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/beego/beego/v2/core/berror"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/beego/beego/v2/core/berror"
|
||||
)
|
||||
|
||||
func TestReadThroughCache_Memory_Get(t *testing.T) {
|
||||
|
||||
1
client/cache/redis/redis.go
vendored
1
client/cache/redis/redis.go
vendored
@ -26,7 +26,6 @@
|
||||
//
|
||||
// bm, err := cache.NewCache("redis", `{"conn":"127.0.0.1:11211"}`)
|
||||
//
|
||||
// more docs http://beego.vip/docs/module/cache.md
|
||||
package redis
|
||||
|
||||
import (
|
||||
|
||||
3
client/cache/redis/redis_test.go
vendored
3
client/cache/redis/redis_test.go
vendored
@ -22,12 +22,11 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/beego/beego/v2/core/berror"
|
||||
|
||||
"github.com/gomodule/redigo/redis"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/beego/beego/v2/client/cache"
|
||||
"github.com/beego/beego/v2/core/berror"
|
||||
)
|
||||
|
||||
func TestRedisCache(t *testing.T) {
|
||||
|
||||
3
client/cache/singleflight.go
vendored
3
client/cache/singleflight.go
vendored
@ -18,8 +18,9 @@ import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/beego/beego/v2/core/berror"
|
||||
"golang.org/x/sync/singleflight"
|
||||
|
||||
"github.com/beego/beego/v2/core/berror"
|
||||
)
|
||||
|
||||
// SingleflightCache
|
||||
|
||||
3
client/cache/ssdb/ssdb_test.go
vendored
3
client/cache/ssdb/ssdb_test.go
vendored
@ -10,11 +10,10 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/beego/beego/v2/core/berror"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/beego/beego/v2/client/cache"
|
||||
"github.com/beego/beego/v2/core/berror"
|
||||
)
|
||||
|
||||
func TestSsdbcacheCache(t *testing.T) {
|
||||
|
||||
3
client/cache/write_through_test.go
vendored
3
client/cache/write_through_test.go
vendored
@ -22,8 +22,9 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/beego/beego/v2/core/berror"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/beego/beego/v2/core/berror"
|
||||
)
|
||||
|
||||
func TestWriteThoughCache_Set(t *testing.T) {
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
// }
|
||||
// fmt.Println(str)
|
||||
//
|
||||
// more docs http://beego.vip/docs/module/httplib.md
|
||||
package httplib
|
||||
|
||||
import (
|
||||
|
||||
@ -19,7 +19,6 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/stretchr/testify/require"
|
||||
"io/ioutil"
|
||||
"net"
|
||||
"net/http"
|
||||
@ -29,6 +28,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestResponse(t *testing.T) {
|
||||
|
||||
@ -151,9 +151,3 @@ like this:
|
||||
|
||||
note: not recommend use this in product env.
|
||||
|
||||
## Docs
|
||||
|
||||
more details and examples in docs and test
|
||||
|
||||
[documents](http://beego.vip/docs/mvc/model/overview.md)
|
||||
|
||||
|
||||
@ -78,7 +78,7 @@ func (builder *FilterChainBuilder) buildSpan(ctx context.Context, span otelTrace
|
||||
span.SetAttributes(attribute.String("component", "beego"))
|
||||
|
||||
if builder.customSpanFunc != nil {
|
||||
builder.customSpanFunc(ctx,span, inv)
|
||||
builder.customSpanFunc(ctx, span, inv)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -51,7 +51,6 @@
|
||||
// num, err = o.Delete(&u)
|
||||
// }
|
||||
//
|
||||
// more docs: http://beego.vip/docs/mvc/model/overview.md
|
||||
package orm
|
||||
|
||||
import (
|
||||
|
||||
@ -27,7 +27,6 @@
|
||||
//
|
||||
// AddHealthCheck("database",&DatabaseCheck{})
|
||||
//
|
||||
// more docs: http://beego.vip/docs/module/toolbox.md
|
||||
package admin
|
||||
|
||||
// AdminCheckList holds health checker map
|
||||
|
||||
@ -37,7 +37,6 @@
|
||||
// cnf.DIY(key string) (interface{}, error)
|
||||
// cnf.GetSection(section string) (map[string]string, error)
|
||||
// cnf.SaveConfigFile(filename string) error
|
||||
// More docs http://beego.vip/docs/module/config.md
|
||||
package config
|
||||
|
||||
import (
|
||||
|
||||
@ -19,8 +19,9 @@ import (
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/beego/beego/v2/core/config"
|
||||
"github.com/pelletier/go-toml"
|
||||
|
||||
"github.com/beego/beego/v2/core/config"
|
||||
)
|
||||
|
||||
const keySeparator = "."
|
||||
|
||||
@ -26,7 +26,6 @@
|
||||
//
|
||||
// cnf, err := config.NewConfig("xml", "config.xml")
|
||||
//
|
||||
// More docs http://beego.vip/docs/module/config.md
|
||||
package xml
|
||||
|
||||
import (
|
||||
@ -39,11 +38,11 @@ import (
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/beego/x2j"
|
||||
"github.com/mitchellh/mapstructure"
|
||||
|
||||
"github.com/beego/beego/v2/core/config"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
"github.com/beego/x2j"
|
||||
)
|
||||
|
||||
// Config is a xml config parser and implements Config interface.
|
||||
|
||||
@ -21,7 +21,6 @@
|
||||
//
|
||||
// cnf, err := config.NewConfig("yaml", "config.yaml")
|
||||
//
|
||||
// More docs http://beego.vip/docs/module/config.md
|
||||
package yaml
|
||||
|
||||
import (
|
||||
|
||||
@ -11,7 +11,9 @@ import (
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
|
||||
var _ = fmt.Errorf
|
||||
|
||||
var _ = math.Inf
|
||||
|
||||
var (
|
||||
@ -339,6 +341,7 @@ func encodeFixed64Log(data []byte, offset int, v uint64) int {
|
||||
data[offset+7] = uint8(v >> 56)
|
||||
return offset + 8
|
||||
}
|
||||
|
||||
func encodeFixed32Log(data []byte, offset int, v uint32) int {
|
||||
data[offset] = uint8(v)
|
||||
data[offset+1] = uint8(v >> 8)
|
||||
@ -346,6 +349,7 @@ func encodeFixed32Log(data []byte, offset int, v uint32) int {
|
||||
data[offset+3] = uint8(v >> 24)
|
||||
return offset + 4
|
||||
}
|
||||
|
||||
func encodeVarintLog(data []byte, offset int, v uint64) int {
|
||||
for v >= 1<<7 {
|
||||
data[offset] = uint8(v&0x7f | 0x80)
|
||||
@ -447,6 +451,7 @@ func sovLog(x uint64) (n int) {
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func sozLog(x uint64) (n int) {
|
||||
return sovLog((x << 1) ^ (x >> 63))
|
||||
}
|
||||
|
||||
@ -30,7 +30,6 @@
|
||||
// log.Debug("debug")
|
||||
// log.Critical("critical")
|
||||
//
|
||||
// more docs http://beego.vip/docs/module/logs.md
|
||||
package logs
|
||||
|
||||
import (
|
||||
|
||||
@ -50,9 +50,5 @@ In your view templates:
|
||||
</ul>
|
||||
{{end}}
|
||||
|
||||
See also
|
||||
|
||||
http://beego.vip/docs/mvc/view/page.md
|
||||
|
||||
*/
|
||||
package pagination
|
||||
|
||||
@ -43,7 +43,6 @@
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// more info: http://beego.vip/docs/mvc/controller/validation.md
|
||||
package validation
|
||||
|
||||
import (
|
||||
|
||||
@ -19,7 +19,6 @@
|
||||
//
|
||||
// ctx := context.Context{Request:req,ResponseWriter:rw}
|
||||
//
|
||||
// more docs http://beego.vip/docs/module/context.md
|
||||
package context
|
||||
|
||||
import (
|
||||
|
||||
@ -96,9 +96,11 @@ type ControllerComments struct {
|
||||
// ControllerCommentsSlice implements the sort interface
|
||||
type ControllerCommentsSlice []ControllerComments
|
||||
|
||||
func (p ControllerCommentsSlice) Len() int { return len(p) }
|
||||
func (p ControllerCommentsSlice) Len() int { return len(p) }
|
||||
|
||||
func (p ControllerCommentsSlice) Less(i, j int) bool { return p[i].Router < p[j].Router }
|
||||
func (p ControllerCommentsSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] }
|
||||
|
||||
func (p ControllerCommentsSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] }
|
||||
|
||||
// Controller defines some basic http request handler operations, such as
|
||||
// http context, template and view, session and xsrf.
|
||||
|
||||
@ -12,6 +12,5 @@ beego is inspired by Tornado, Sinatra and Flask with the added benefit of some G
|
||||
beego.Run()
|
||||
}
|
||||
|
||||
more information: http://beego.vip
|
||||
*/
|
||||
package web
|
||||
|
||||
@ -53,8 +53,8 @@ var defaultRejectionResponse = RejectionResponse{
|
||||
// according to the configuration.
|
||||
func NewLimiter(opts ...limiterOption) web.FilterFunc {
|
||||
l := &limiter{
|
||||
buckets: make(map[string]bucket),
|
||||
sessionKey: defaultSessionKey,
|
||||
buckets: make(map[string]bucket),
|
||||
sessionKey: defaultSessionKey,
|
||||
rate: time.Millisecond * 10,
|
||||
capacity: 100,
|
||||
bucketFactory: newTokenBucket,
|
||||
|
||||
@ -29,7 +29,6 @@
|
||||
// go globalSessions.GC()
|
||||
// }
|
||||
//
|
||||
// more docs: http://beego.vip/docs/module/session.md
|
||||
package couchbase
|
||||
|
||||
import (
|
||||
|
||||
@ -29,7 +29,6 @@
|
||||
// go globalSessions.GC()
|
||||
// }
|
||||
//
|
||||
// more docs: http://beego.vip/docs/module/session.md
|
||||
package memcache
|
||||
|
||||
import (
|
||||
|
||||
@ -37,7 +37,6 @@
|
||||
// go globalSessions.GC()
|
||||
// }
|
||||
//
|
||||
// more docs: http://beego.vip/docs/module/session.md
|
||||
package mysql
|
||||
|
||||
import (
|
||||
@ -47,7 +46,6 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
// import mysql driver
|
||||
_ "github.com/go-sql-driver/mysql"
|
||||
|
||||
"github.com/beego/beego/v2/server/web/session"
|
||||
|
||||
@ -47,7 +47,6 @@
|
||||
// go globalSessions.GC()
|
||||
// }
|
||||
//
|
||||
// more docs: http://beego.vip/docs/module/session.md
|
||||
package postgres
|
||||
|
||||
import (
|
||||
@ -57,7 +56,6 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
// import postgresql Driver
|
||||
_ "github.com/lib/pq"
|
||||
|
||||
"github.com/beego/beego/v2/server/web/session"
|
||||
|
||||
@ -29,7 +29,6 @@
|
||||
// go globalSessions.GC()
|
||||
// }
|
||||
//
|
||||
// more docs: http://beego.vip/docs/module/session.md
|
||||
package redis
|
||||
|
||||
import (
|
||||
|
||||
@ -29,7 +29,6 @@
|
||||
// go globalSessions.GC()
|
||||
// }
|
||||
//
|
||||
// more docs: http://beego.vip/docs/module/session.md
|
||||
package redis_cluster
|
||||
|
||||
import (
|
||||
|
||||
@ -24,7 +24,6 @@
|
||||
// go globalSessions.GC()
|
||||
// }
|
||||
//
|
||||
// more docs: http://beego.vip/docs/module/session.md
|
||||
package session
|
||||
|
||||
import (
|
||||
|
||||
@ -242,7 +242,6 @@ func Htmlunquote(text string) string {
|
||||
// /login?next=/
|
||||
// /user/John%20Doe
|
||||
//
|
||||
// more detail http://beego.vip/docs/mvc/controller/urlbuilding.md
|
||||
func URLFor(endpoint string, values ...interface{}) string {
|
||||
return BeeApp.Handlers.URLFor(endpoint, values...)
|
||||
}
|
||||
|
||||
@ -697,6 +697,7 @@ func (ms *MapSorter) Sort() {
|
||||
}
|
||||
|
||||
func (ms *MapSorter) Len() int { return len(ms.Keys) }
|
||||
|
||||
func (ms *MapSorter) Less(i, j int) bool {
|
||||
if ms.Vals[i].GetNext(context.Background()).IsZero() {
|
||||
return false
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user