Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
beego
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
beego
Commits
f201859f
Commit
f201859f
authored
Aug 11, 2014
by
astaxie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
beego: fix the addTree
parent
52fdfc56
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
tree.go
tree.go
+8
-8
No files found.
tree.go
View file @
f201859f
...
@@ -108,9 +108,13 @@ func (t *Tree) addtree(segments []string, tree *Tree, wildcards []string, reg st
...
@@ -108,9 +108,13 @@ func (t *Tree) addtree(segments []string, tree *Tree, wildcards []string, reg st
if
w
==
"."
||
w
==
":"
{
if
w
==
"."
||
w
==
":"
{
continue
continue
}
}
if
w
==
":splat"
{
regexpStr
=
"/(.+)"
+
regexpStr
}
else
{
regexpStr
=
"/([^/]+)"
+
regexpStr
regexpStr
=
"/([^/]+)"
+
regexpStr
}
}
}
}
}
reg
=
reg
+
regexpStr
reg
=
reg
+
regexpStr
t
.
wildcard
.
addtree
(
segments
[
1
:
],
tree
,
append
(
wildcards
,
params
...
),
reg
)
t
.
wildcard
.
addtree
(
segments
[
1
:
],
tree
,
append
(
wildcards
,
params
...
),
reg
)
}
else
{
}
else
{
...
@@ -145,20 +149,16 @@ func filterTreeWithPrefix(t *Tree, wildcards []string, reg string) {
...
@@ -145,20 +149,16 @@ func filterTreeWithPrefix(t *Tree, wildcards []string, reg string) {
}
}
}
else
{
}
else
{
if
l
.
regexps
!=
nil
{
if
l
.
regexps
!=
nil
{
filterCards
:=
[]
string
{}
for
_
,
v
:=
range
l
.
wildcards
{
if
v
==
":"
||
v
==
"."
{
continue
}
filterCards
=
append
(
filterCards
,
v
)
}
l
.
wildcards
=
filterCards
for
_
,
w
:=
range
wildcards
{
for
_
,
w
:=
range
wildcards
{
if
w
==
"."
||
w
==
":"
{
if
w
==
"."
||
w
==
":"
{
continue
continue
}
}
if
w
==
":splat"
{
reg
=
"(.+)/"
+
reg
}
else
{
reg
=
"([^/]+)/"
+
reg
reg
=
"([^/]+)/"
+
reg
}
}
}
l
.
regexps
=
regexp
.
MustCompile
(
"^"
+
reg
+
strings
.
Trim
(
l
.
regexps
.
String
(),
"^$"
)
+
"$"
)
l
.
regexps
=
regexp
.
MustCompile
(
"^"
+
reg
+
strings
.
Trim
(
l
.
regexps
.
String
(),
"^$"
)
+
"$"
)
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment