From 0958174bc8ea8c51ac73244bdfdaaa8618336cd1 Mon Sep 17 00:00:00 2001 From: Ming Deng Date: Thu, 12 Nov 2020 21:36:11 +0800 Subject: [PATCH 1/2] update doc --- README.md | 19 +++++++++++++++++-- core/config/global.go | 1 - 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 934fc429..0c9bfc15 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,22 @@ beego is used for rapid development of RESTful APIs, web apps and backend services in Go. It is inspired by Tornado, Sinatra and Flask. beego has some Go-specific features such as interfaces and struct embedding. -###### More info at [beego.me](http://beego.me). +###### More info at [beego.me](http://beego.me). + +> If you could not open this website, go to [beedoc](https://github.com/beego/beedoc) + +## beego 1.x and 2.x + +We recently release beego 2.0.0-beta, and its structure change a lot, so you may get some error + +1. If you are working on beego v1.x please try `go get github.com/astaxie/beego@v1.12.3` +2. If you want to try beego 2.0.0, run `go get github.com/astaxie/beego@develop` + +We are still working on fix bug and documentation of v2.x. And v2.x's doc will be released with v2.0.0. + +## Next version + +v1.12.4 will be released on Jan 2021 And v2.0.0 will be released next month. ## Quick Start @@ -25,7 +40,7 @@ It is inspired by Tornado, Sinatra and Flask. beego has some Go-specific feature #### Download and install - go get github.com/astaxie/beego + go get -u github.com/astaxie/beego #### Create file `hello.go` ```go diff --git a/core/config/global.go b/core/config/global.go index 5491fe2c..a7fb795f 100644 --- a/core/config/global.go +++ b/core/config/global.go @@ -18,7 +18,6 @@ package config // for most users, they only need to use those methods var globalInstance Configer - // InitGlobalInstance will ini the global instance // If you want to use specific implementation, don't forget to import it. // e.g. _ import "github.com/astaxie/beego/core/config/etcd" From 00ed1c3733871c6d46343365d49ad0c1ec3f7a39 Mon Sep 17 00:00:00 2001 From: Ming Deng Date: Wed, 25 Nov 2020 20:13:23 +0800 Subject: [PATCH 2/2] change the globalInstance to read conf/app.conf --- core/config/ini.go | 2 +- server/web/router.go | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/core/config/ini.go b/core/config/ini.go index 4d17fb7a..70d00980 100644 --- a/core/config/ini.go +++ b/core/config/ini.go @@ -519,7 +519,7 @@ func (c *IniConfigContainer) Unmarshaler(prefix string, obj interface{}, opt ... func init() { Register("ini", &IniConfig{}) - err := InitGlobalInstance("ini", "config/app.conf") + err := InitGlobalInstance("ini", "conf/app.conf") if err != nil { logs.Warn("init global config instance failed. If you donot use this, just ignore it. ", err) } diff --git a/server/web/router.go b/server/web/router.go index 7bb89d82..d729013b 100644 --- a/server/web/router.go +++ b/server/web/router.go @@ -273,7 +273,6 @@ func (p *ControllerRegister) Include(cList ...ControllerInterface) { for _, f := range a.Filters { p.InsertFilter(f.Pattern, f.Pos, f.Filter, WithReturnOnOutput(f.ReturnOnOutput), WithResetParams(f.ResetParams)) } - p.addWithMethodParams(a.Router, c, a.MethodParams, strings.Join(a.AllowHTTPMethods, ",")+":"+a.Method) } }