From 06e09b0f87294c22c05ecabd3cc99653808c583b Mon Sep 17 00:00:00 2001 From: Ming Deng Date: Wed, 16 Dec 2020 13:20:41 +0800 Subject: [PATCH] upgrade version to 2 --- Makefile | 2 +- README.md | 4 +- cmd/bee.go | 38 +++++++++---------- cmd/commands/api/apiapp.go | 12 +++--- cmd/commands/bale/bale.go | 10 ++--- cmd/commands/beefix/fix.go | 10 ++--- cmd/commands/beefix/fix1To2.go | 18 +++++++-- cmd/commands/beefix/fixTo1.6.go | 9 ++--- cmd/commands/beegopro/beegopro.go | 6 +-- cmd/commands/command.go | 4 +- cmd/commands/dev/cmd.go | 4 +- cmd/commands/dev/githook.go | 2 +- cmd/commands/dlv/dlv_amd64.go | 12 +++--- cmd/commands/dockerize/dockerize.go | 8 ++-- cmd/commands/generate/generate.go | 14 +++---- cmd/commands/hprose/hprose.go | 14 +++---- cmd/commands/migrate/migrate.go | 10 ++--- cmd/commands/new/new.go | 10 ++--- cmd/commands/pack/pack.go | 8 ++-- cmd/commands/rs/rs.go | 12 +++--- cmd/commands/run/docs.go | 2 +- cmd/commands/run/reload.go | 2 +- cmd/commands/run/run.go | 10 ++--- cmd/commands/run/watch.go | 8 ++-- cmd/commands/server/server.go | 8 ++-- cmd/commands/update/update.go | 8 ++-- cmd/commands/version/banner.go | 2 +- cmd/commands/version/version.go | 10 ++--- config/conf.go | 4 +- generate/g.go | 2 +- generate/g_appcode.go | 6 +-- generate/g_controllers.go | 6 +-- generate/g_hproseappcode.go | 6 +-- generate/g_migration.go | 6 +-- generate/g_model.go | 6 +-- generate/g_scaffold.go | 6 +-- generate/g_views.go | 6 +-- generate/swaggergen/g_docs.go | 4 +- go.mod | 2 +- gosimple.ignore | 6 +-- internal/app/module/beegopro/config.go | 4 +- internal/app/module/beegopro/container.go | 8 ++-- internal/app/module/beegopro/migration.go | 4 +- internal/app/module/beegopro/parser_mysql.go | 4 +- internal/app/module/beegopro/pongo2.go | 2 +- internal/app/module/beegopro/render.go | 4 +- internal/app/module/beegopro/schema.go | 8 ++-- internal/app/module/beegopro/schema_model.go | 2 +- .../app/module/beegopro/schema_mysql_model.go | 2 +- .../app/module/beegopro/schema_text_model.go | 2 +- internal/app/module/beegopro/util.go | 4 +- internal/pkg/git/repository.go | 6 +-- internal/pkg/utils/file.go | 2 +- logger/logger.go | 2 +- main.go | 8 ++-- staticcheck.ignore | 2 +- utils/notification.go | 2 +- utils/utils.go | 8 ++-- utils/version.go | 2 +- 59 files changed, 202 insertions(+), 191 deletions(-) diff --git a/Makefile b/Makefile index ea71c95..603e0b4 100644 --- a/Makefile +++ b/Makefile @@ -24,6 +24,6 @@ clean: publish: mkdir -p bin/$(VERSION) cd bin/$(VERSION) - xgo -v -x --targets="windows/*,darwin/*,linux/386,linux/amd64,linux/arm-5,linux/arm64" -out bee_$(VERSION) github.com/beego/bee + xgo -v -x --targets="windows/*,darwin/*,linux/386,linux/amd64,linux/arm-5,linux/arm64" -out bee_$(VERSION) github.com/beego/bee/v2 cd .. ghr -u beego -r bee $(VERSION) $(VERSION) diff --git a/README.md b/README.md index 9387bfd..1e667f7 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Bee is a command-line tool facilitating development of Beego-based application. To install `bee` use the `go get` command: ```bash -go get github.com/beego/bee +go get github.com/beego/bee/v2 ``` Then you can add `bee` binary to PATH environment variable in your `~/.bashrc` or `~/.bash_profile` file: @@ -28,7 +28,7 @@ export PATH=$PATH:/bin > If you already have `bee` installed, updating `bee` is simple: ```bash -go get -u github.com/beego/bee +go get -u github.com/beego/bee/v2 ``` ## Basic commands diff --git a/cmd/bee.go b/cmd/bee.go index e921c00..3ead4cb 100644 --- a/cmd/bee.go +++ b/cmd/bee.go @@ -16,25 +16,25 @@ package cmd import ( - "github.com/beego/bee/cmd/commands" - _ "github.com/beego/bee/cmd/commands/api" - _ "github.com/beego/bee/cmd/commands/bale" - _ "github.com/beego/bee/cmd/commands/beefix" - _ "github.com/beego/bee/cmd/commands/beegopro" - _ "github.com/beego/bee/cmd/commands/dev" - _ "github.com/beego/bee/cmd/commands/dlv" - _ "github.com/beego/bee/cmd/commands/dockerize" - _ "github.com/beego/bee/cmd/commands/generate" - _ "github.com/beego/bee/cmd/commands/hprose" - _ "github.com/beego/bee/cmd/commands/migrate" - _ "github.com/beego/bee/cmd/commands/new" - _ "github.com/beego/bee/cmd/commands/pack" - _ "github.com/beego/bee/cmd/commands/rs" - _ "github.com/beego/bee/cmd/commands/run" - _ "github.com/beego/bee/cmd/commands/server" - _ "github.com/beego/bee/cmd/commands/update" - _ "github.com/beego/bee/cmd/commands/version" - "github.com/beego/bee/utils" + "github.com/beego/bee/v2/cmd/commands" + _ "github.com/beego/bee/v2/cmd/commands/api" + _ "github.com/beego/bee/v2/cmd/commands/bale" + _ "github.com/beego/bee/v2/cmd/commands/beefix" + _ "github.com/beego/bee/v2/cmd/commands/beegopro" + _ "github.com/beego/bee/v2/cmd/commands/dev" + _ "github.com/beego/bee/v2/cmd/commands/dlv" + _ "github.com/beego/bee/v2/cmd/commands/dockerize" + _ "github.com/beego/bee/v2/cmd/commands/generate" + _ "github.com/beego/bee/v2/cmd/commands/hprose" + _ "github.com/beego/bee/v2/cmd/commands/migrate" + _ "github.com/beego/bee/v2/cmd/commands/new" + _ "github.com/beego/bee/v2/cmd/commands/pack" + _ "github.com/beego/bee/v2/cmd/commands/rs" + _ "github.com/beego/bee/v2/cmd/commands/run" + _ "github.com/beego/bee/v2/cmd/commands/server" + _ "github.com/beego/bee/v2/cmd/commands/update" + _ "github.com/beego/bee/v2/cmd/commands/version" + "github.com/beego/bee/v2/utils" ) func IfGenerateDocs(name string, args []string) bool { diff --git a/cmd/commands/api/apiapp.go b/cmd/commands/api/apiapp.go index 4bf6bba..8cc9633 100644 --- a/cmd/commands/api/apiapp.go +++ b/cmd/commands/api/apiapp.go @@ -20,13 +20,13 @@ import ( path "path/filepath" "strings" - "github.com/beego/bee/logger/colors" + "github.com/beego/bee/v2/logger/colors" - "github.com/beego/bee/cmd/commands" - "github.com/beego/bee/cmd/commands/version" - "github.com/beego/bee/generate" - beeLogger "github.com/beego/bee/logger" - "github.com/beego/bee/utils" + "github.com/beego/bee/v2/cmd/commands" + "github.com/beego/bee/v2/cmd/commands/version" + "github.com/beego/bee/v2/generate" + beeLogger "github.com/beego/bee/v2/logger" + "github.com/beego/bee/v2/utils" ) var CmdApiapp = &commands.Command{ diff --git a/cmd/commands/bale/bale.go b/cmd/commands/bale/bale.go index 8ba9641..87361ea 100644 --- a/cmd/commands/bale/bale.go +++ b/cmd/commands/bale/bale.go @@ -24,11 +24,11 @@ import ( "runtime" "strings" - "github.com/beego/bee/cmd/commands" - "github.com/beego/bee/cmd/commands/version" - "github.com/beego/bee/config" - beeLogger "github.com/beego/bee/logger" - "github.com/beego/bee/utils" + "github.com/beego/bee/v2/cmd/commands" + "github.com/beego/bee/v2/cmd/commands/version" + "github.com/beego/bee/v2/config" + beeLogger "github.com/beego/bee/v2/logger" + "github.com/beego/bee/v2/utils" ) var CmdBale = &commands.Command{ diff --git a/cmd/commands/beefix/fix.go b/cmd/commands/beefix/fix.go index 5090881..59efab7 100644 --- a/cmd/commands/beefix/fix.go +++ b/cmd/commands/beefix/fix.go @@ -3,10 +3,10 @@ package beefix import ( "strings" - "github.com/beego/bee/cmd/commands" - "github.com/beego/bee/cmd/commands/version" - beeLogger "github.com/beego/bee/logger" - "github.com/beego/bee/utils" + "github.com/beego/bee/v2/cmd/commands" + "github.com/beego/bee/v2/cmd/commands/version" + beeLogger "github.com/beego/bee/v2/logger" + "github.com/beego/bee/v2/utils" ) var CmdFix = &commands.Command{ @@ -36,7 +36,7 @@ func init() { func runFix(cmd *commands.Command, args []string) int { t := target.String() - if t == "" || t == "1.6"{ + if t == "" || t == "1.6" { return fixTo16(cmd, args) } else if strings.HasPrefix(t, "2") { // upgrade to v2 diff --git a/cmd/commands/beefix/fix1To2.go b/cmd/commands/beefix/fix1To2.go index 41e4bb8..f4c7e80 100644 --- a/cmd/commands/beefix/fix1To2.go +++ b/cmd/commands/beefix/fix1To2.go @@ -1,4 +1,4 @@ -// Copyright 2020 +// Copyright 2020 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,20 +18,32 @@ import ( "os" "os/exec" - beeLogger "github.com/beego/bee/logger" + beeLogger "github.com/beego/bee/v2/logger" ) func fix1To2() int { beeLogger.Log.Info("Upgrading the application...") - cmdStr := `find ./ -name '*.go' -type f -exec sed -i '' -e 's/github.com\/astaxie\/beego/github.com\/beego\/beego\/v2\/adapter/g' {} \;` + cmdStr := `go get -u github.com/beego/beego/v2@develop` err := runShell(cmdStr) if err != nil { + beeLogger.Log.Error(err.Error()) + beeLogger.Log.Error(`fetch v2.0.1 failed. Please try to run: export GO111MODULE=on +and if your network is not stable, please try to use proxy, for example: export GOPROXY=https://goproxy.cn;' +`) + return 1 + } + + cmdStr = `find ./ -name '*.go' -type f -exec sed -i '' -e 's/github.com\/astaxie\/beego/github.com\/beego\/beego\/v2\/adapter/g' {} \;` + err = runShell(cmdStr) + if err != nil { + beeLogger.Log.Error(err.Error()) return 1 } cmdStr = `find ./ -name '*.go' -type f -exec sed -i '' -e 's/"github.com\/beego\/beego\/v2\/adapter"/beego "github.com\/beego\/beego\/v2\/adapter"/g' {} \;` err = runShell(cmdStr) if err != nil { + beeLogger.Log.Error(err.Error()) return 1 } return 0 diff --git a/cmd/commands/beefix/fixTo1.6.go b/cmd/commands/beefix/fixTo1.6.go index 8e38f67..b49e57b 100644 --- a/cmd/commands/beefix/fixTo1.6.go +++ b/cmd/commands/beefix/fixTo1.6.go @@ -1,4 +1,4 @@ -// Copyright 2020 +// Copyright 2020 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -24,9 +24,9 @@ import ( "regexp" "strings" - "github.com/beego/bee/cmd/commands" - beeLogger "github.com/beego/bee/logger" - "github.com/beego/bee/logger/colors" + "github.com/beego/bee/v2/cmd/commands" + beeLogger "github.com/beego/bee/v2/logger" + "github.com/beego/bee/v2/logger/colors" ) // fixTo16 upgrade beego to 1.6 @@ -228,4 +228,3 @@ func fixFile(file string) error { } return ioutil.WriteFile(file, []byte(fixed), 0666) } - diff --git a/cmd/commands/beegopro/beegopro.go b/cmd/commands/beegopro/beegopro.go index b094a0a..3407fe6 100644 --- a/cmd/commands/beegopro/beegopro.go +++ b/cmd/commands/beegopro/beegopro.go @@ -16,9 +16,9 @@ package beegopro import ( "strings" - "github.com/beego/bee/cmd/commands" - "github.com/beego/bee/internal/app/module/beegopro" - "github.com/beego/bee/logger" + "github.com/beego/bee/v2/cmd/commands" + "github.com/beego/bee/v2/internal/app/module/beegopro" + "github.com/beego/bee/v2/logger" ) var CmdBeegoPro = &commands.Command{ diff --git a/cmd/commands/command.go b/cmd/commands/command.go index 95a1891..16f4a1c 100644 --- a/cmd/commands/command.go +++ b/cmd/commands/command.go @@ -6,8 +6,8 @@ import ( "os" "strings" - "github.com/beego/bee/logger/colors" - "github.com/beego/bee/utils" + "github.com/beego/bee/v2/logger/colors" + "github.com/beego/bee/v2/utils" ) // Command is the unit of execution diff --git a/cmd/commands/dev/cmd.go b/cmd/commands/dev/cmd.go index dda319a..bddc6e9 100644 --- a/cmd/commands/dev/cmd.go +++ b/cmd/commands/dev/cmd.go @@ -15,8 +15,8 @@ package dev import ( - "github.com/beego/bee/cmd/commands" - beeLogger "github.com/beego/bee/logger" + "github.com/beego/bee/v2/cmd/commands" + beeLogger "github.com/beego/bee/v2/logger" ) var CmdDev = &commands.Command{ diff --git a/cmd/commands/dev/githook.go b/cmd/commands/dev/githook.go index be0d18a..0f14e38 100644 --- a/cmd/commands/dev/githook.go +++ b/cmd/commands/dev/githook.go @@ -17,7 +17,7 @@ package dev import ( "os" - beeLogger "github.com/beego/bee/logger" + beeLogger "github.com/beego/bee/v2/logger" ) var preCommit = ` diff --git a/cmd/commands/dlv/dlv_amd64.go b/cmd/commands/dlv/dlv_amd64.go index a127a47..38ad28a 100644 --- a/cmd/commands/dlv/dlv_amd64.go +++ b/cmd/commands/dlv/dlv_amd64.go @@ -24,16 +24,16 @@ import ( "strings" "time" - "github.com/beego/bee/cmd/commands" - "github.com/beego/bee/cmd/commands/version" - beeLogger "github.com/beego/bee/logger" - "github.com/beego/bee/utils" + "github.com/beego/bee/v2/cmd/commands" + "github.com/beego/bee/v2/cmd/commands/version" + beeLogger "github.com/beego/bee/v2/logger" + "github.com/beego/bee/v2/utils" + "github.com/fsnotify/fsnotify" + "github.com/go-delve/delve/pkg/terminal" "github.com/go-delve/delve/service" "github.com/go-delve/delve/service/debugger" "github.com/go-delve/delve/service/rpc2" "github.com/go-delve/delve/service/rpccommon" - "github.com/go-delve/delve/pkg/terminal" - "github.com/fsnotify/fsnotify" ) var cmdDlv = &commands.Command{ diff --git a/cmd/commands/dockerize/dockerize.go b/cmd/commands/dockerize/dockerize.go index 3aad82e..10b013e 100644 --- a/cmd/commands/dockerize/dockerize.go +++ b/cmd/commands/dockerize/dockerize.go @@ -22,10 +22,10 @@ import ( "strings" "text/template" - "github.com/beego/bee/cmd/commands" - "github.com/beego/bee/cmd/commands/version" - beeLogger "github.com/beego/bee/logger" - "github.com/beego/bee/utils" + "github.com/beego/bee/v2/cmd/commands" + "github.com/beego/bee/v2/cmd/commands/version" + beeLogger "github.com/beego/bee/v2/logger" + "github.com/beego/bee/v2/utils" ) const dockerBuildTemplate = `FROM {{.BaseImage}} diff --git a/cmd/commands/generate/generate.go b/cmd/commands/generate/generate.go index d8bee28..d780ee5 100644 --- a/cmd/commands/generate/generate.go +++ b/cmd/commands/generate/generate.go @@ -17,13 +17,13 @@ import ( "os" "strings" - "github.com/beego/bee/cmd/commands" - "github.com/beego/bee/cmd/commands/version" - "github.com/beego/bee/config" - "github.com/beego/bee/generate" - "github.com/beego/bee/generate/swaggergen" - "github.com/beego/bee/logger" - "github.com/beego/bee/utils" + "github.com/beego/bee/v2/cmd/commands" + "github.com/beego/bee/v2/cmd/commands/version" + "github.com/beego/bee/v2/config" + "github.com/beego/bee/v2/generate" + "github.com/beego/bee/v2/generate/swaggergen" + "github.com/beego/bee/v2/logger" + "github.com/beego/bee/v2/utils" ) var CmdGenerate = &commands.Command{ diff --git a/cmd/commands/hprose/hprose.go b/cmd/commands/hprose/hprose.go index ba97b03..8ac756a 100644 --- a/cmd/commands/hprose/hprose.go +++ b/cmd/commands/hprose/hprose.go @@ -6,14 +6,14 @@ import ( "path" "strings" - "github.com/beego/bee/logger/colors" + "github.com/beego/bee/v2/logger/colors" - "github.com/beego/bee/cmd/commands" - "github.com/beego/bee/cmd/commands/api" - "github.com/beego/bee/cmd/commands/version" - "github.com/beego/bee/generate" - beeLogger "github.com/beego/bee/logger" - "github.com/beego/bee/utils" + "github.com/beego/bee/v2/cmd/commands" + "github.com/beego/bee/v2/cmd/commands/api" + "github.com/beego/bee/v2/cmd/commands/version" + "github.com/beego/bee/v2/generate" + beeLogger "github.com/beego/bee/v2/logger" + "github.com/beego/bee/v2/utils" ) var CmdHproseapp = &commands.Command{ diff --git a/cmd/commands/migrate/migrate.go b/cmd/commands/migrate/migrate.go index 50cf58b..36073e1 100644 --- a/cmd/commands/migrate/migrate.go +++ b/cmd/commands/migrate/migrate.go @@ -23,12 +23,12 @@ import ( "strings" "time" - "github.com/beego/bee/cmd/commands" - "github.com/beego/bee/cmd/commands/version" - "github.com/beego/bee/config" - "github.com/beego/bee/utils" + "github.com/beego/bee/v2/cmd/commands" + "github.com/beego/bee/v2/cmd/commands/version" + "github.com/beego/bee/v2/config" + "github.com/beego/bee/v2/utils" - beeLogger "github.com/beego/bee/logger" + beeLogger "github.com/beego/bee/v2/logger" ) var CmdMigrate = &commands.Command{ diff --git a/cmd/commands/new/new.go b/cmd/commands/new/new.go index c179100..ed05450 100644 --- a/cmd/commands/new/new.go +++ b/cmd/commands/new/new.go @@ -20,11 +20,11 @@ import ( path "path/filepath" "strings" - "github.com/beego/bee/cmd/commands" - "github.com/beego/bee/cmd/commands/version" - beeLogger "github.com/beego/bee/logger" - "github.com/beego/bee/logger/colors" - "github.com/beego/bee/utils" + "github.com/beego/bee/v2/cmd/commands" + "github.com/beego/bee/v2/cmd/commands/version" + beeLogger "github.com/beego/bee/v2/logger" + "github.com/beego/bee/v2/logger/colors" + "github.com/beego/bee/v2/utils" ) var gopath utils.DocValue diff --git a/cmd/commands/pack/pack.go b/cmd/commands/pack/pack.go index 36540ea..88deae2 100644 --- a/cmd/commands/pack/pack.go +++ b/cmd/commands/pack/pack.go @@ -18,10 +18,10 @@ import ( "syscall" "time" - "github.com/beego/bee/cmd/commands" - "github.com/beego/bee/cmd/commands/version" - beeLogger "github.com/beego/bee/logger" - "github.com/beego/bee/utils" + "github.com/beego/bee/v2/cmd/commands" + "github.com/beego/bee/v2/cmd/commands/version" + beeLogger "github.com/beego/bee/v2/logger" + "github.com/beego/bee/v2/utils" ) var CmdPack = &commands.Command{ diff --git a/cmd/commands/rs/rs.go b/cmd/commands/rs/rs.go index c520bee..3c8ecd4 100644 --- a/cmd/commands/rs/rs.go +++ b/cmd/commands/rs/rs.go @@ -24,12 +24,12 @@ import ( "strings" - "github.com/beego/bee/cmd/commands" - "github.com/beego/bee/cmd/commands/version" - "github.com/beego/bee/config" - "github.com/beego/bee/logger" - "github.com/beego/bee/logger/colors" - "github.com/beego/bee/utils" + "github.com/beego/bee/v2/cmd/commands" + "github.com/beego/bee/v2/cmd/commands/version" + "github.com/beego/bee/v2/config" + "github.com/beego/bee/v2/logger" + "github.com/beego/bee/v2/logger/colors" + "github.com/beego/bee/v2/utils" ) var cmdRs = &commands.Command{ diff --git a/cmd/commands/run/docs.go b/cmd/commands/run/docs.go index f7b13f3..6ad382a 100644 --- a/cmd/commands/run/docs.go +++ b/cmd/commands/run/docs.go @@ -7,7 +7,7 @@ import ( "os" "strings" - beeLogger "github.com/beego/bee/logger" + beeLogger "github.com/beego/bee/v2/logger" ) var ( diff --git a/cmd/commands/run/reload.go b/cmd/commands/run/reload.go index 4cd731a..2981f89 100644 --- a/cmd/commands/run/reload.go +++ b/cmd/commands/run/reload.go @@ -18,7 +18,7 @@ import ( "net/http" "time" - beeLogger "github.com/beego/bee/logger" + beeLogger "github.com/beego/bee/v2/logger" "github.com/gorilla/websocket" ) diff --git a/cmd/commands/run/run.go b/cmd/commands/run/run.go index 9eec587..03b28cf 100644 --- a/cmd/commands/run/run.go +++ b/cmd/commands/run/run.go @@ -20,11 +20,11 @@ import ( "runtime" "strings" - "github.com/beego/bee/cmd/commands" - "github.com/beego/bee/cmd/commands/version" - "github.com/beego/bee/config" - beeLogger "github.com/beego/bee/logger" - "github.com/beego/bee/utils" + "github.com/beego/bee/v2/cmd/commands" + "github.com/beego/bee/v2/cmd/commands/version" + "github.com/beego/bee/v2/config" + beeLogger "github.com/beego/bee/v2/logger" + "github.com/beego/bee/v2/utils" ) var CmdRun = &commands.Command{ diff --git a/cmd/commands/run/watch.go b/cmd/commands/run/watch.go index 5aae690..ba950f4 100644 --- a/cmd/commands/run/watch.go +++ b/cmd/commands/run/watch.go @@ -24,10 +24,10 @@ import ( "sync" "time" - "github.com/beego/bee/config" - beeLogger "github.com/beego/bee/logger" - "github.com/beego/bee/logger/colors" - "github.com/beego/bee/utils" + "github.com/beego/bee/v2/config" + beeLogger "github.com/beego/bee/v2/logger" + "github.com/beego/bee/v2/logger/colors" + "github.com/beego/bee/v2/utils" "github.com/fsnotify/fsnotify" ) diff --git a/cmd/commands/server/server.go b/cmd/commands/server/server.go index 8c06574..1c68c3e 100644 --- a/cmd/commands/server/server.go +++ b/cmd/commands/server/server.go @@ -17,13 +17,13 @@ package apiapp import ( "net/http" - beeLogger "github.com/beego/bee/logger" + beeLogger "github.com/beego/bee/v2/logger" "os" - "github.com/beego/bee/cmd/commands" - "github.com/beego/bee/cmd/commands/version" - "github.com/beego/bee/utils" + "github.com/beego/bee/v2/cmd/commands" + "github.com/beego/bee/v2/cmd/commands/version" + "github.com/beego/bee/v2/utils" ) var CmdServer = &commands.Command{ diff --git a/cmd/commands/update/update.go b/cmd/commands/update/update.go index 2c8ff8a..57255d6 100644 --- a/cmd/commands/update/update.go +++ b/cmd/commands/update/update.go @@ -5,16 +5,16 @@ import ( "os" "os/exec" - "github.com/beego/bee/cmd/commands" - "github.com/beego/bee/config" - beeLogger "github.com/beego/bee/logger" + "github.com/beego/bee/v2/cmd/commands" + "github.com/beego/bee/v2/config" + beeLogger "github.com/beego/bee/v2/logger" ) var CmdUpdate = &commands.Command{ UsageLine: "update", Short: "Update Bee", Long: ` -Automatic run command "go get -u github.com/beego/bee" for selfupdate +Automatic run command "go get -u github.com/beego/bee/v2" for selfupdate `, Run: updateBee, } diff --git a/cmd/commands/version/banner.go b/cmd/commands/version/banner.go index 0ab367d..2b2618e 100644 --- a/cmd/commands/version/banner.go +++ b/cmd/commands/version/banner.go @@ -9,7 +9,7 @@ import ( "time" - beeLogger "github.com/beego/bee/logger" + beeLogger "github.com/beego/bee/v2/logger" ) // RuntimeInfo holds information about the current runtime. diff --git a/cmd/commands/version/version.go b/cmd/commands/version/version.go index 7d30fbc..3518bc5 100644 --- a/cmd/commands/version/version.go +++ b/cmd/commands/version/version.go @@ -16,11 +16,11 @@ import ( "gopkg.in/yaml.v2" - "github.com/beego/bee/cmd/commands" - "github.com/beego/bee/config" - beeLogger "github.com/beego/bee/logger" - "github.com/beego/bee/logger/colors" - "github.com/beego/bee/utils" + "github.com/beego/bee/v2/cmd/commands" + "github.com/beego/bee/v2/config" + beeLogger "github.com/beego/bee/v2/logger" + "github.com/beego/bee/v2/logger/colors" + "github.com/beego/bee/v2/utils" ) const verboseVersionBanner string = `%s%s______ diff --git a/config/conf.go b/config/conf.go index 7c03dcd..5478186 100644 --- a/config/conf.go +++ b/config/conf.go @@ -21,14 +21,14 @@ import ( "gopkg.in/yaml.v2" - beeLogger "github.com/beego/bee/logger" + beeLogger "github.com/beego/bee/v2/logger" ) const confVer = 0 const ( Version = "2.0.1" - GitRemotePath = "github.com/beego/bee" + GitRemotePath = "github.com/beego/bee/v2" ) var Conf = struct { diff --git a/generate/g.go b/generate/g.go index 691acc7..764932d 100644 --- a/generate/g.go +++ b/generate/g.go @@ -14,7 +14,7 @@ package generate -import "github.com/beego/bee/utils" +import "github.com/beego/bee/v2/utils" var SQLDriver utils.DocValue var SQLConn utils.DocValue diff --git a/generate/g_appcode.go b/generate/g_appcode.go index 3de7d5a..d884364 100644 --- a/generate/g_appcode.go +++ b/generate/g_appcode.go @@ -25,9 +25,9 @@ import ( "regexp" "strings" - beeLogger "github.com/beego/bee/logger" - "github.com/beego/bee/logger/colors" - "github.com/beego/bee/utils" + beeLogger "github.com/beego/bee/v2/logger" + "github.com/beego/bee/v2/logger/colors" + "github.com/beego/bee/v2/utils" _ "github.com/go-sql-driver/mysql" _ "github.com/lib/pq" ) diff --git a/generate/g_controllers.go b/generate/g_controllers.go index 2d92416..e603415 100644 --- a/generate/g_controllers.go +++ b/generate/g_controllers.go @@ -20,9 +20,9 @@ import ( "path" "strings" - beeLogger "github.com/beego/bee/logger" - "github.com/beego/bee/logger/colors" - "github.com/beego/bee/utils" + beeLogger "github.com/beego/bee/v2/logger" + "github.com/beego/bee/v2/logger/colors" + "github.com/beego/bee/v2/utils" ) func GenerateController(cname, currpath string) { diff --git a/generate/g_hproseappcode.go b/generate/g_hproseappcode.go index eb5f84c..63f8a8d 100644 --- a/generate/g_hproseappcode.go +++ b/generate/g_hproseappcode.go @@ -24,9 +24,9 @@ import ( "path" "strings" - beeLogger "github.com/beego/bee/logger" - "github.com/beego/bee/logger/colors" - "github.com/beego/bee/utils" + beeLogger "github.com/beego/bee/v2/logger" + "github.com/beego/bee/v2/logger/colors" + "github.com/beego/bee/v2/utils" _ "github.com/go-sql-driver/mysql" _ "github.com/lib/pq" ) diff --git a/generate/g_migration.go b/generate/g_migration.go index 0fd005b..890bae5 100644 --- a/generate/g_migration.go +++ b/generate/g_migration.go @@ -21,9 +21,9 @@ import ( "strings" "time" - "github.com/beego/bee/logger" - "github.com/beego/bee/logger/colors" - "github.com/beego/bee/utils" + "github.com/beego/bee/v2/logger" + "github.com/beego/bee/v2/logger/colors" + "github.com/beego/bee/v2/utils" ) const ( diff --git a/generate/g_model.go b/generate/g_model.go index dcafd3e..96dd4a0 100644 --- a/generate/g_model.go +++ b/generate/g_model.go @@ -21,9 +21,9 @@ import ( "path" "strings" - beeLogger "github.com/beego/bee/logger" - "github.com/beego/bee/logger/colors" - "github.com/beego/bee/utils" + beeLogger "github.com/beego/bee/v2/logger" + "github.com/beego/bee/v2/logger/colors" + "github.com/beego/bee/v2/utils" ) func GenerateModel(mname, fields, currpath string) { diff --git a/generate/g_scaffold.go b/generate/g_scaffold.go index d752789..42ec8a2 100644 --- a/generate/g_scaffold.go +++ b/generate/g_scaffold.go @@ -3,9 +3,9 @@ package generate import ( "strings" - "github.com/beego/bee/cmd/commands/migrate" - beeLogger "github.com/beego/bee/logger" - "github.com/beego/bee/utils" + "github.com/beego/bee/v2/cmd/commands/migrate" + beeLogger "github.com/beego/bee/v2/logger" + "github.com/beego/bee/v2/utils" ) func GenerateScaffold(sname, fields, currpath, driver, conn string) { diff --git a/generate/g_views.go b/generate/g_views.go index 95d99bd..8a67f5b 100644 --- a/generate/g_views.go +++ b/generate/g_views.go @@ -19,9 +19,9 @@ import ( "os" "path" - beeLogger "github.com/beego/bee/logger" - "github.com/beego/bee/logger/colors" - "github.com/beego/bee/utils" + beeLogger "github.com/beego/bee/v2/logger" + "github.com/beego/bee/v2/logger/colors" + "github.com/beego/bee/v2/utils" ) // recipe diff --git a/generate/swaggergen/g_docs.go b/generate/swaggergen/g_docs.go index 52c7876..2c6311a 100644 --- a/generate/swaggergen/g_docs.go +++ b/generate/swaggergen/g_docs.go @@ -35,9 +35,9 @@ import ( yaml "gopkg.in/yaml.v2" - "github.com/beego/beego/v2/server/web/swagger" + beeLogger "github.com/beego/bee/v2/logger" "github.com/beego/beego/v2/core/utils" - beeLogger "github.com/beego/bee/logger" + "github.com/beego/beego/v2/server/web/swagger" ) const ( diff --git a/go.mod b/go.mod index 962910b..aa446cb 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/beego/bee +module github.com/beego/bee/v2 go 1.13 diff --git a/gosimple.ignore b/gosimple.ignore index 4619dba..2a98f7c 100644 --- a/gosimple.ignore +++ b/gosimple.ignore @@ -1,3 +1,3 @@ -github.com/beego/bee/cmd/commands/run/*.go:S1024 -github.com/beego/bee/cmd/commands/dlv/*.go:S1024 -github.com/beego/bee/utils/*.go:S1026 +github.com/beego/bee/v2/cmd/commands/run/*.go:S1024 +github.com/beego/bee/v2/cmd/commands/dlv/*.go:S1024 +github.com/beego/bee/v2/utils/*.go:S1026 diff --git a/internal/app/module/beegopro/config.go b/internal/app/module/beegopro/config.go index b305d02..fe781e7 100644 --- a/internal/app/module/beegopro/config.go +++ b/internal/app/module/beegopro/config.go @@ -3,8 +3,8 @@ package beegopro import ( "io/ioutil" - "github.com/beego/bee/internal/pkg/utils" - beeLogger "github.com/beego/bee/logger" + "github.com/beego/bee/v2/internal/pkg/utils" + beeLogger "github.com/beego/bee/v2/logger" ) var CompareExcept = []string{"@BeeGenerateTime"} diff --git a/internal/app/module/beegopro/container.go b/internal/app/module/beegopro/container.go index 69c9084..f12b70f 100644 --- a/internal/app/module/beegopro/container.go +++ b/internal/app/module/beegopro/container.go @@ -6,10 +6,10 @@ import ( "sync" "time" - "github.com/beego/bee/internal/pkg/git" - "github.com/beego/bee/internal/pkg/system" - beeLogger "github.com/beego/bee/logger" - "github.com/beego/bee/utils" + "github.com/beego/bee/v2/internal/pkg/git" + "github.com/beego/bee/v2/internal/pkg/system" + beeLogger "github.com/beego/bee/v2/logger" + "github.com/beego/bee/v2/utils" "github.com/davecgh/go-spew/spew" "github.com/pelletier/go-toml" "github.com/spf13/viper" diff --git a/internal/app/module/beegopro/migration.go b/internal/app/module/beegopro/migration.go index ec1eb08..a2cf409 100644 --- a/internal/app/module/beegopro/migration.go +++ b/internal/app/module/beegopro/migration.go @@ -6,8 +6,8 @@ import ( "path/filepath" "strings" - beeLogger "github.com/beego/bee/logger" - "github.com/beego/bee/utils" + beeLogger "github.com/beego/bee/v2/logger" + "github.com/beego/bee/v2/utils" ) var SQL utils.DocValue diff --git a/internal/app/module/beegopro/parser_mysql.go b/internal/app/module/beegopro/parser_mysql.go index af5e80c..2e96bfc 100644 --- a/internal/app/module/beegopro/parser_mysql.go +++ b/internal/app/module/beegopro/parser_mysql.go @@ -4,8 +4,8 @@ import ( "database/sql" "fmt" - "github.com/beego/bee/internal/pkg/utils" - beeLogger "github.com/beego/bee/logger" + "github.com/beego/bee/v2/internal/pkg/utils" + beeLogger "github.com/beego/bee/v2/logger" ) type MysqlParser struct { diff --git a/internal/app/module/beegopro/pongo2.go b/internal/app/module/beegopro/pongo2.go index 24ee5b2..13c14e4 100644 --- a/internal/app/module/beegopro/pongo2.go +++ b/internal/app/module/beegopro/pongo2.go @@ -4,7 +4,7 @@ import ( "strings" "unicode/utf8" - "github.com/beego/bee/utils" + "github.com/beego/bee/v2/utils" "github.com/flosch/pongo2" ) diff --git a/internal/app/module/beegopro/render.go b/internal/app/module/beegopro/render.go index 3721621..b030815 100644 --- a/internal/app/module/beegopro/render.go +++ b/internal/app/module/beegopro/render.go @@ -11,8 +11,8 @@ import ( "github.com/flosch/pongo2" "github.com/smartwalle/pongo2render" - "github.com/beego/bee/internal/pkg/system" - beeLogger "github.com/beego/bee/logger" + "github.com/beego/bee/v2/internal/pkg/system" + beeLogger "github.com/beego/bee/v2/logger" ) // render diff --git a/internal/app/module/beegopro/schema.go b/internal/app/module/beegopro/schema.go index 9a2baac..8d0f2d3 100644 --- a/internal/app/module/beegopro/schema.go +++ b/internal/app/module/beegopro/schema.go @@ -6,10 +6,10 @@ import ( "strings" "sync" - "github.com/beego/bee/internal/pkg/command" - "github.com/beego/bee/internal/pkg/system" - beeLogger "github.com/beego/bee/logger" - "github.com/beego/bee/utils" + "github.com/beego/bee/v2/internal/pkg/command" + "github.com/beego/bee/v2/internal/pkg/system" + beeLogger "github.com/beego/bee/v2/logger" + "github.com/beego/bee/v2/utils" "github.com/flosch/pongo2" "github.com/smartwalle/pongo2render" ) diff --git a/internal/app/module/beegopro/schema_model.go b/internal/app/module/beegopro/schema_model.go index 22e7507..6d36acf 100644 --- a/internal/app/module/beegopro/schema_model.go +++ b/internal/app/module/beegopro/schema_model.go @@ -3,7 +3,7 @@ package beegopro import ( "strings" - "github.com/beego/bee/utils" + "github.com/beego/bee/v2/utils" ) // parse get the model info diff --git a/internal/app/module/beegopro/schema_mysql_model.go b/internal/app/module/beegopro/schema_mysql_model.go index 7bc2d8b..4fca376 100644 --- a/internal/app/module/beegopro/schema_mysql_model.go +++ b/internal/app/module/beegopro/schema_mysql_model.go @@ -4,7 +4,7 @@ import ( "database/sql" "errors" - "github.com/beego/bee/logger" + "github.com/beego/bee/v2/logger" ) type TableSchema struct { diff --git a/internal/app/module/beegopro/schema_text_model.go b/internal/app/module/beegopro/schema_text_model.go index 3483d8f..898e7f5 100644 --- a/internal/app/module/beegopro/schema_text_model.go +++ b/internal/app/module/beegopro/schema_text_model.go @@ -1,7 +1,7 @@ package beegopro import ( - beeLogger "github.com/beego/bee/logger" + beeLogger "github.com/beego/bee/v2/logger" ) type TextModel struct { diff --git a/internal/app/module/beegopro/util.go b/internal/app/module/beegopro/util.go index 22a668a..7cf1bae 100644 --- a/internal/app/module/beegopro/util.go +++ b/internal/app/module/beegopro/util.go @@ -11,8 +11,8 @@ import ( "strings" "time" - "github.com/beego/bee/internal/pkg/utils" - beeLogger "github.com/beego/bee/logger" + "github.com/beego/bee/v2/internal/pkg/utils" + beeLogger "github.com/beego/bee/v2/logger" ) // write to file diff --git a/internal/pkg/git/repository.go b/internal/pkg/git/repository.go index ebad8dd..83c1179 100644 --- a/internal/pkg/git/repository.go +++ b/internal/pkg/git/repository.go @@ -8,9 +8,9 @@ import ( "strconv" "strings" - "github.com/beego/bee/internal/pkg/command" - "github.com/beego/bee/internal/pkg/utils" - beeLogger "github.com/beego/bee/logger" + "github.com/beego/bee/v2/internal/pkg/command" + "github.com/beego/bee/v2/internal/pkg/utils" + beeLogger "github.com/beego/bee/v2/logger" ) // git tag diff --git a/internal/pkg/utils/file.go b/internal/pkg/utils/file.go index 5d931eb..72015e6 100644 --- a/internal/pkg/utils/file.go +++ b/internal/pkg/utils/file.go @@ -3,7 +3,7 @@ package utils import ( "os" - beeLogger "github.com/beego/bee/logger" + beeLogger "github.com/beego/bee/v2/logger" ) // Mkdir ... diff --git a/logger/logger.go b/logger/logger.go index beb5bc5..5cc1fa8 100644 --- a/logger/logger.go +++ b/logger/logger.go @@ -24,7 +24,7 @@ import ( "text/template" "time" - "github.com/beego/bee/logger/colors" + "github.com/beego/bee/v2/logger/colors" ) var errInvalidLogLevel = errors.New("logger: invalid log level") diff --git a/main.go b/main.go index 251ee51..2222ca9 100644 --- a/main.go +++ b/main.go @@ -18,10 +18,10 @@ import ( "log" "os" - "github.com/beego/bee/cmd" - "github.com/beego/bee/cmd/commands" - "github.com/beego/bee/config" - "github.com/beego/bee/utils" + "github.com/beego/bee/v2/cmd" + "github.com/beego/bee/v2/cmd/commands" + "github.com/beego/bee/v2/config" + "github.com/beego/bee/v2/utils" ) func main() { diff --git a/staticcheck.ignore b/staticcheck.ignore index 70d9589..858e4ce 100644 --- a/staticcheck.ignore +++ b/staticcheck.ignore @@ -1 +1 @@ -github.com/beego/bee/generate/swaggergen/*.go:SA1024 +github.com/beego/bee/v2/generate/swaggergen/*.go:SA1024 diff --git a/utils/notification.go b/utils/notification.go index b19b49f..d42249a 100644 --- a/utils/notification.go +++ b/utils/notification.go @@ -21,7 +21,7 @@ import ( "runtime" - "github.com/beego/bee/config" + "github.com/beego/bee/v2/config" ) const appName = "Beego" diff --git a/utils/utils.go b/utils/utils.go index 0e788ca..cee89d9 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -32,10 +32,10 @@ import ( "time" "unicode" - "github.com/beego/bee/config" - "github.com/beego/bee/internal/pkg/system" - beeLogger "github.com/beego/bee/logger" - "github.com/beego/bee/logger/colors" + "github.com/beego/bee/v2/config" + "github.com/beego/bee/v2/internal/pkg/system" + beeLogger "github.com/beego/bee/v2/logger" + "github.com/beego/bee/v2/logger/colors" ) type tagName struct { diff --git a/utils/version.go b/utils/version.go index 035df59..05da3dc 100644 --- a/utils/version.go +++ b/utils/version.go @@ -1,4 +1,4 @@ -// Copyright 2020 +// Copyright 2020 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License.