Beego’s Router runs normally locally, and notmatch appears after it is loaded onto the server.

  golang, question
// Test.go
 package controllers
 
 import (
 "models"
 "github.com/astaxie/beego"
 )
 
 type TestController struct {
 beego.Controller
 }
 
 // Get   ...
 func (c *TestController) Get() {
 testList := models.GetTestList()
 c.Data["testList"] = testList
 
 c.TplName = "test/index.html"
 
 }
// Router.go
 package routers
 
 import (
 "nav/controllers"
 
 "github.com/astaxie/beego"
 )
 
 func init() {
 beego.AutoRouter(&controllers.TestController{})
 
 beego.Router("/test", &controllers.TestController{})
 }
//  main.html
 <li><a href="/test"><font color="black">TEST</font></a></li>

If you run on the local (Mac OS), you can click jump to open it. if you put it on the server, it will open 404, log will display notmatch, and other links will normally match.

What is the reason? Ask for the answer!

This problem is caused by an import error in some packages. Sorry, my mistake.