From 3c91360d72f6798c5638cd5e55cd145f29491639 Mon Sep 17 00:00:00 2001 From: astaxie Date: Tue, 3 Dec 2013 21:37:39 +0800 Subject: [PATCH] dictinct system pkg and third pkg --- admin.go | 3 ++- app.go | 3 ++- cache/memcache.go | 1 + cache/redis.go | 1 + config.go | 2 -- config/xml.go | 3 ++- config/yaml.go | 3 ++- context/context.go | 3 ++- context/input.go | 3 ++- controller.go | 5 +++-- fiter_test.go | 3 ++- router.go | 7 ++++--- session/sess_mysql.go | 3 ++- session/sess_redis.go | 3 ++- 14 files changed, 27 insertions(+), 16 deletions(-) diff --git a/admin.go b/admin.go index b0cbcfcd..64b6610a 100644 --- a/admin.go +++ b/admin.go @@ -2,9 +2,10 @@ package beego import ( "fmt" - "github.com/astaxie/beego/toolbox" "net/http" "time" + + "github.com/astaxie/beego/toolbox" ) var BeeAdminApp *AdminApp diff --git a/app.go b/app.go index 3aa3bf97..9cd16ccd 100644 --- a/app.go +++ b/app.go @@ -2,11 +2,12 @@ package beego import ( "fmt" - "github.com/astaxie/beego/context" "net" "net/http" "net/http/fcgi" "time" + + "github.com/astaxie/beego/context" ) type FilterFunc func(*context.Context) diff --git a/cache/memcache.go b/cache/memcache.go index 5cf208f3..c0b726d0 100644 --- a/cache/memcache.go +++ b/cache/memcache.go @@ -3,6 +3,7 @@ package cache import ( "encoding/json" "errors" + "github.com/beego/memcache" ) diff --git a/cache/redis.go b/cache/redis.go index 993f30cc..27648416 100644 --- a/cache/redis.go +++ b/cache/redis.go @@ -3,6 +3,7 @@ package cache import ( "encoding/json" "errors" + "github.com/beego/redigo/redis" ) diff --git a/config.go b/config.go index 32370d60..bd540b6e 100644 --- a/config.go +++ b/config.go @@ -26,7 +26,6 @@ var ( HttpKeyFile string RecoverPanic bool AutoRender bool - PprofOn bool ViewsPath string RunMode string //"dev" or "prod" AppConfig config.ConfigContainer @@ -71,7 +70,6 @@ func InitConfig() { RunMode = "dev" //default runmod AutoRender = true RecoverPanic = true - PprofOn = false ViewsPath = "views" SessionOn = false SessionProvider = "memory" diff --git a/config/xml.go b/config/xml.go index e08738ba..7f3807ef 100644 --- a/config/xml.go +++ b/config/xml.go @@ -4,11 +4,12 @@ package config import ( "errors" - "github.com/beego/x2j" "io/ioutil" "os" "strconv" "sync" + + "github.com/beego/x2j" ) type XMLConfig struct { diff --git a/config/yaml.go b/config/yaml.go index 08b51b47..04bb0940 100644 --- a/config/yaml.go +++ b/config/yaml.go @@ -4,11 +4,12 @@ import ( "bytes" "encoding/json" "errors" - "github.com/beego/goyaml2" "io/ioutil" "log" "os" "sync" + + "github.com/beego/goyaml2" ) type YAMLConfig struct { diff --git a/context/context.go b/context/context.go index d2de3887..f13e4856 100644 --- a/context/context.go +++ b/context/context.go @@ -1,8 +1,9 @@ package context import ( - "github.com/astaxie/beego/middleware" "net/http" + + "github.com/astaxie/beego/middleware" ) type Context struct { diff --git a/context/input.go b/context/input.go index 809f2366..c20c8b14 100644 --- a/context/input.go +++ b/context/input.go @@ -2,11 +2,12 @@ package context import ( "bytes" - "github.com/astaxie/beego/session" "io/ioutil" "net/http" "strconv" "strings" + + "github.com/astaxie/beego/session" ) type BeegoInput struct { diff --git a/controller.go b/controller.go index 0c4b62f9..78e6c34f 100644 --- a/controller.go +++ b/controller.go @@ -7,8 +7,6 @@ import ( "encoding/base64" "errors" "fmt" - "github.com/astaxie/beego/context" - "github.com/astaxie/beego/session" "html/template" "io" "io/ioutil" @@ -20,6 +18,9 @@ import ( "strconv" "strings" "time" + + "github.com/astaxie/beego/context" + "github.com/astaxie/beego/session" ) type Controller struct { diff --git a/fiter_test.go b/fiter_test.go index 4a1b8639..4e9dae6a 100644 --- a/fiter_test.go +++ b/fiter_test.go @@ -1,10 +1,11 @@ package beego import ( - "github.com/astaxie/beego/context" "net/http" "net/http/httptest" "testing" + + "github.com/astaxie/beego/context" ) var FilterUser = func(ctx *context.Context) { diff --git a/router.go b/router.go index 395e7eb7..bc2a4e14 100644 --- a/router.go +++ b/router.go @@ -2,9 +2,6 @@ package beego import ( "fmt" - beecontext "github.com/astaxie/beego/context" - "github.com/astaxie/beego/middleware" - "github.com/astaxie/beego/toolbox" "net/http" "net/url" "os" @@ -14,6 +11,10 @@ import ( "strconv" "strings" "time" + + beecontext "github.com/astaxie/beego/context" + "github.com/astaxie/beego/middleware" + "github.com/astaxie/beego/toolbox" ) const ( diff --git a/session/sess_mysql.go b/session/sess_mysql.go index 10dcf20b..f1a59d4f 100644 --- a/session/sess_mysql.go +++ b/session/sess_mysql.go @@ -9,9 +9,10 @@ package session import ( "database/sql" - _ "github.com/go-sql-driver/mysql" "sync" "time" + + _ "github.com/go-sql-driver/mysql" ) var mysqlpder = &MysqlProvider{} diff --git a/session/sess_redis.go b/session/sess_redis.go index 230dd079..b6f088c3 100644 --- a/session/sess_redis.go +++ b/session/sess_redis.go @@ -1,10 +1,11 @@ package session import ( - "github.com/beego/redigo/redis" "strconv" "strings" "sync" + + "github.com/beego/redigo/redis" ) var redispder = &RedisProvider{}