The study recorded the framework of beego

beego framework study notes

Firstly, a change from frame framework beego the simplest case, the official document has some not elaborate. main.go code is as follows:

package main
import (
    _ "myprojetc/routers"
    "github.com/astaxie/beego"
)

func main() {
    beego.Run()
}

Run part of the analysis from two codes, import packets and does inside the Run function beego dry matter

import package

  • "myprojetc/routers"
  • "github.com/astaxie/beego"

See from the code, the document cites two packages; again and so, in fact, it is useless to several packages, the final point to the beego this package. This can be understood, the init function to initialize beego and some global variable. Then this process is init function.

beego the Run function

Guess you like

Origin www.cnblogs.com/meiguhuaxian/p/11827674.html