format code

This commit is contained in:
Deng Ming
2022-12-23 10:25:06 +08:00
parent 15fa7e15d4
commit 5ade9fa025
64 changed files with 35 additions and 109 deletions

View File

@@ -28,7 +28,6 @@
// bm.IsExist("astaxie")
// bm.Delete("astaxie")
//
// more docs http://beego.vip/docs/module/cache.md
package cache
import (

View File

@@ -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 (

View File

@@ -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 (

View File

@@ -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 (

View File

@@ -26,7 +26,6 @@
//
// cnf, err := config.NewConfig("xml", "config.xml")
//
// More docs http://beego.vip/docs/module/config.md
package xml
import (

View File

@@ -26,7 +26,6 @@
//
// cnf, err := config.NewConfig("yaml", "config.yaml")
//
// More docs http://beego.vip/docs/module/config.md
package yaml
import (

View File

@@ -19,7 +19,6 @@
//
// ctx := context.Context{Request:req,ResponseWriter:rw}
//
// more docs http://beego.vip/docs/module/context.md
package context
import (

View File

@@ -28,7 +28,6 @@
// }
// fmt.Println(str)
//
// more docs http://beego.vip/docs/module/httplib.md
package httplib
import (

View File

@@ -30,7 +30,6 @@
// log.Debug("debug")
// log.Critical("critical")
//
// more docs http://beego.vip/docs/module/logs.md
package logs
import (

View File

@@ -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")
}

View File

@@ -51,7 +51,6 @@
// num, err = o.Delete(&u)
// }
//
// more docs: http://beego.vip/docs/mvc/model/overview.md
package orm
import (

View File

@@ -29,7 +29,6 @@
// go globalSessions.GC()
// }
//
// more docs: http://beego.vip/docs/module/session.md
package couchbase
import (

View File

@@ -29,7 +29,6 @@
// go globalSessions.GC()
// }
//
// more docs: http://beego.vip/docs/module/session.md
package memcache
import (

View File

@@ -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"

View File

@@ -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"

View File

@@ -29,7 +29,6 @@
// go globalSessions.GC()
// }
//
// more docs: http://beego.vip/docs/module/session.md
package redis
import (

View File

@@ -29,7 +29,6 @@
// go globalSessions.GC()
// }
//
// more docs: http://beego.vip/docs/module/session.md
package redis_cluster
import (

View File

@@ -24,7 +24,6 @@
// go globalSessions.GC()
// }
//
// more docs: http://beego.vip/docs/module/session.md
package session
import (

View File

@@ -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...)
}

View File

@@ -27,7 +27,6 @@
//
// AddHealthCheck("database",&DatabaseCheck{})
//
// more docs: http://beego.vip/docs/module/toolbox.md
package toolbox
import (

View File

@@ -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

View File

@@ -50,9 +50,5 @@ In your view templates:
</ul>
{{end}}
See also
http://beego.vip/docs/mvc/view/page.md
*/
package pagination

View File

@@ -43,7 +43,6 @@
// }
// }
//
// more info: http://beego.vip/docs/mvc/controller/validation.md
package validation
import (