21586586 by astaxie

Merge pull request #1198 from kongjian/develop

remove space after int()& add sort for commentsRouter file
2 parents 499ee09d e1d7bc88
......@@ -24,6 +24,7 @@ import (
"io/ioutil"
"os"
"path"
"sort"
"strings"
"github.com/astaxie/beego/utils"
......@@ -36,7 +37,7 @@ import (
)
func init() {
{{.globalinfo}}
{{.globalinfo}}
}
`
......@@ -129,7 +130,13 @@ func genRouterCode() {
os.Mkdir(path.Join(workPath, "routers"), 0755)
Info("generate router from comments")
var globalinfo string
for k, cList := range genInfoList {
sortKey := make([]string, 0)
for k, _ := range genInfoList {
sortKey = append(sortKey, k)
}
sort.Strings(sortKey)
for _, k := range sortKey {
cList := genInfoList[k]
for _, c := range cList {
allmethod := "nil"
if len(c.AllowHTTPMethods) > 0 {
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!