mirror of
https://github.com/astaxie/beego.git
synced 2024-11-04 21:50:54 +00:00
Merge pull request #1198 from kongjian/develop
remove space after int()& add sort for commentsRouter file
This commit is contained in:
commit
21586586ba
11
parser.go
11
parser.go
@ -24,6 +24,7 @@ import (
|
|||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/astaxie/beego/utils"
|
"github.com/astaxie/beego/utils"
|
||||||
@ -36,7 +37,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
{{.globalinfo}}
|
{{.globalinfo}}
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
@ -129,7 +130,13 @@ func genRouterCode() {
|
|||||||
os.Mkdir(path.Join(workPath, "routers"), 0755)
|
os.Mkdir(path.Join(workPath, "routers"), 0755)
|
||||||
Info("generate router from comments")
|
Info("generate router from comments")
|
||||||
var globalinfo string
|
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 {
|
for _, c := range cList {
|
||||||
allmethod := "nil"
|
allmethod := "nil"
|
||||||
if len(c.AllowHTTPMethods) > 0 {
|
if len(c.AllowHTTPMethods) > 0 {
|
||||||
|
Loading…
Reference in New Issue
Block a user