Beego comment route is not generated?

runmode has been set to dev, annotations and written, but no commentsRouter.go file has been generated
OS win 10 Beego version master version

runmode = "dev"

router.go

func init() {
    ns := beego.NewNamespace("/admin",

        beego.NSNamespace("/contents",
            beego.NSInclude(
                &controllers.ContentController{},
            ),
        ),
    )
    beego.AddNamespace(ns)
}

controllers/content.go

type ContentController struct {
    BaseController
}

// @router / [get]
func (this *ContentController) GetContents() {
    defer this.ServeJSON()
        // .....
}
Mar.11,2021

looks like no problem at all. You can generate routes by executing bee run in the directory where main.go is located.


add the following code under main.go, and then execute go generate

//go:generate sh -c "echo 'package routers; import \"github.com/astaxie/beego\"; func init() {beego.BConfig.RunMode = beego.DEV}' > routers/0.go"
//go:generate sh -c "echo 'package routers; import \"os\"; func init() {os.Exit(0)}' > routers/z.go"
//go:generate go run $GOFILE
//go:generate sh -c "rm routers/0.go routers/z.go"

projects under windows must be in the src directory before they can be generated

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3693d-2c03c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3693d-2c03c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?