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
d31ac49e
Commit
d31ac49e
authored
Jul 26, 2013
by
miraclesu
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/astaxie/beego
into form
parents
60afcd06
6373379d
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
13 deletions
+4
-13
log.go
log.go
+1
-1
router.go
router.go
+3
-2
template.go
template.go
+0
-1
utils.go
utils.go
+0
-9
No files found.
log.go
View file @
d31ac49e
...
...
@@ -32,7 +32,7 @@ type FileLogWriter struct {
rotate
bool
startLock
sync
.
Mutex
//
only one log can writer
to the file
startLock
sync
.
Mutex
//
Only one log can write
to the file
}
type
MuxWriter
struct
{
...
...
router.go
View file @
d31ac49e
...
...
@@ -94,7 +94,8 @@ func (p *ControllerRegistor) Add(pattern string, c ControllerInterface, mappingM
}
}
}
t
:=
reflect
.
Indirect
(
reflect
.
ValueOf
(
c
))
.
Type
()
reflectVal
:=
reflect
.
ValueOf
(
c
)
t
:=
reflect
.
Indirect
(
reflectVal
)
.
Type
()
methods
:=
make
(
map
[
string
]
string
)
if
len
(
mappingMethods
)
>
0
{
semi
:=
strings
.
Split
(
mappingMethods
[
0
],
";"
)
...
...
@@ -106,7 +107,7 @@ func (p *ControllerRegistor) Add(pattern string, c ControllerInterface, mappingM
comma
:=
strings
.
Split
(
colon
[
0
],
","
)
for
_
,
m
:=
range
comma
{
if
m
==
"*"
||
inSlice
(
strings
.
ToLower
(
m
),
HTTPMETHOD
)
{
if
_
,
ok
:=
t
.
MethodByName
(
colon
[
1
]);
ok
{
if
val
:=
reflectVal
.
MethodByName
(
colon
[
1
]);
val
.
IsValid
()
{
methods
[
strings
.
ToLower
(
m
)]
=
colon
[
1
]
}
else
{
panic
(
colon
[
1
]
+
" method don't exist in the controller "
+
t
.
Name
())
...
...
template.go
View file @
d31ac49e
...
...
@@ -23,7 +23,6 @@ func init() {
beegoTplFuncMap
=
make
(
template
.
FuncMap
)
BeeTemplateExt
=
make
([]
string
,
0
)
BeeTemplateExt
=
append
(
BeeTemplateExt
,
"tpl"
,
"html"
)
beegoTplFuncMap
[
"markdown"
]
=
MarkDown
beegoTplFuncMap
[
"dateformat"
]
=
DateFormat
beegoTplFuncMap
[
"date"
]
=
Date
beegoTplFuncMap
[
"compare"
]
=
Compare
...
...
utils.go
View file @
d31ac49e
...
...
@@ -2,7 +2,6 @@ package beego
import
(
"fmt"
"github.com/russross/blackfriday"
"html/template"
"net/url"
"reflect"
...
...
@@ -20,14 +19,6 @@ func webTime(t time.Time) string {
return
ftime
}
// MarkDown parses a string in MarkDown format and returns HTML. Used by the template parser as "markdown"
func
MarkDown
(
raw
string
)
(
output
template
.
HTML
)
{
input
:=
[]
byte
(
raw
)
bOutput
:=
blackfriday
.
MarkdownBasic
(
input
)
output
=
template
.
HTML
(
string
(
bOutput
))
return
}
func
Substr
(
s
string
,
start
,
length
int
)
string
{
bt
:=
[]
rune
(
s
)
if
start
<
0
{
...
...
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