Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
二次元的罪恶王冠
beego
提交
856fde28
B
beego
项目概览
二次元的罪恶王冠
/
beego
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
B
beego
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
856fde28
编写于
3月 17, 2017
作者:
S
Sergey Lanzman
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add unconverted support
上级
21d1267c
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
25 addition
and
29 deletion
+25
-29
.travis.yml
.travis.yml
+2
-0
cache/ssdb/ssdb.go
cache/ssdb/ssdb.go
+2
-2
config.go
config.go
+1
-1
logs/alils/log.pb.go
logs/alils/log.pb.go
+1
-1
logs/smtp.go
logs/smtp.go
+1
-1
orm/utils.go
orm/utils.go
+4
-4
session/ledis/ledis_session.go
session/ledis/ledis_session.go
+1
-1
templatefunc.go
templatefunc.go
+12
-18
utils/captcha/image.go
utils/captcha/image.go
+1
-1
未找到文件。
.travis.yml
浏览文件 @
856fde28
...
...
@@ -33,6 +33,7 @@ install:
-
go get github.com/ssdb/gossdb/ssdb
-
go get github.com/cloudflare/golz4
-
go get github.com/gogo/protobuf/proto
-
go get -u github.com/mdempsky/unconvert
before_script
:
-
psql --version
-
sh -c "if [ '$ORM_DRIVER' = 'postgres' ]; then psql -c 'create database orm_test;' -U postgres; fi"
...
...
@@ -47,5 +48,6 @@ after_script:
- rm -rf ./res/var/*
script
:
-
go test -v ./...
-
unconvert $(go list ./... | grep -v /vendor/)
addons
:
postgresql
:
"
9.4"
cache/ssdb/ssdb.go
浏览文件 @
856fde28
...
...
@@ -53,7 +53,7 @@ func (rc *Cache) GetMulti(keys []string) []interface{} {
resSize
:=
len
(
res
)
if
err
==
nil
{
for
i
:=
1
;
i
<
resSize
;
i
+=
2
{
values
=
append
(
values
,
string
(
res
[
i
+
1
])
)
values
=
append
(
values
,
res
[
i
+
1
]
)
}
return
values
}
...
...
@@ -175,7 +175,7 @@ func (rc *Cache) ClearAll() error {
}
keys
:=
[]
string
{}
for
i
:=
1
;
i
<
size
;
i
+=
2
{
keys
=
append
(
keys
,
string
(
resp
[
i
])
)
keys
=
append
(
keys
,
resp
[
i
]
)
}
_
,
e
:=
rc
.
conn
.
Do
(
"multi_del"
,
keys
)
if
e
!=
nil
{
...
...
config.go
浏览文件 @
856fde28
...
...
@@ -345,7 +345,7 @@ func assignSingleConfig(p interface{}, ac config.Configer) {
case
reflect
.
String
:
pf
.
SetString
(
ac
.
DefaultString
(
name
,
pf
.
String
()))
case
reflect
.
Int
,
reflect
.
Int64
:
pf
.
SetInt
(
int64
(
ac
.
DefaultInt64
(
name
,
pf
.
Int
()
)))
pf
.
SetInt
(
ac
.
DefaultInt64
(
name
,
pf
.
Int
(
)))
case
reflect
.
Bool
:
pf
.
SetBool
(
ac
.
DefaultBool
(
name
,
pf
.
Bool
()))
case
reflect
.
Struct
:
...
...
logs/alils/log.pb.go
浏览文件 @
856fde28
...
...
@@ -395,7 +395,7 @@ func sovLog(x uint64) (n int) {
return
n
}
func
sozLog
(
x
uint64
)
(
n
int
)
{
return
sovLog
(
uint64
((
x
<<
1
)
^
uint64
((
int64
(
x
)
>>
63
))
))
return
sovLog
(
(
x
<<
1
)
^
(
x
>>
63
))
}
func
(
m
*
Log
)
Unmarshal
(
data
[]
byte
)
error
{
var
hasFields
[
1
]
uint64
...
...
logs/smtp.go
浏览文件 @
856fde28
...
...
@@ -106,7 +106,7 @@ func (s *SMTPWriter) sendMail(hostAddressWithPort string, auth smtp.Auth, fromAd
if
err
!=
nil
{
return
err
}
_
,
err
=
w
.
Write
(
[]
byte
(
msgContent
)
)
_
,
err
=
w
.
Write
(
msgContent
)
if
err
!=
nil
{
return
err
}
...
...
orm/utils.go
浏览文件 @
856fde28
...
...
@@ -92,11 +92,11 @@ func (f StrTo) Int64() (int64, error) {
i
:=
new
(
big
.
Int
)
ni
,
ok
:=
i
.
SetString
(
f
.
String
(),
10
)
// octal
if
!
ok
{
return
int64
(
v
)
,
err
return
v
,
err
}
return
ni
.
Int64
(),
nil
}
return
int64
(
v
)
,
err
return
v
,
err
}
// Uint string to uint
...
...
@@ -130,11 +130,11 @@ func (f StrTo) Uint64() (uint64, error) {
i
:=
new
(
big
.
Int
)
ni
,
ok
:=
i
.
SetString
(
f
.
String
(),
10
)
if
!
ok
{
return
uint64
(
v
)
,
err
return
v
,
err
}
return
ni
.
Uint64
(),
nil
}
return
uint64
(
v
)
,
err
return
v
,
err
}
// String string to string
...
...
session/ledis/ledis_session.go
浏览文件 @
856fde28
...
...
@@ -150,7 +150,7 @@ func (lp *Provider) SessionRegenerate(oldsid, sid string) (session.Store, error)
if
len
(
kvs
)
==
0
{
kv
=
make
(
map
[
interface
{}]
interface
{})
}
else
{
kv
,
err
=
session
.
DecodeGob
(
[]
byte
(
kvs
)
)
kv
,
err
=
session
.
DecodeGob
(
kvs
)
if
err
!=
nil
{
return
nil
,
err
}
...
...
templatefunc.go
浏览文件 @
856fde28
...
...
@@ -46,26 +46,25 @@ func Substr(s string, start, length int) string {
// HTML2str returns escaping text convert from html.
func
HTML2str
(
html
string
)
string
{
src
:=
string
(
html
)
re
,
_
:=
regexp
.
Compile
(
"
\\
<[
\\
S
\\
s]+?
\\
>"
)
src
=
re
.
ReplaceAllStringFunc
(
src
,
strings
.
ToLower
)
html
=
re
.
ReplaceAllStringFunc
(
html
,
strings
.
ToLower
)
//remove STYLE
re
,
_
=
regexp
.
Compile
(
"
\\
<style[
\\
S
\\
s]+?
\\
</style
\\
>"
)
src
=
re
.
ReplaceAllString
(
src
,
""
)
html
=
re
.
ReplaceAllString
(
html
,
""
)
//remove SCRIPT
re
,
_
=
regexp
.
Compile
(
"
\\
<script[
\\
S
\\
s]+?
\\
</script
\\
>"
)
src
=
re
.
ReplaceAllString
(
src
,
""
)
html
=
re
.
ReplaceAllString
(
html
,
""
)
re
,
_
=
regexp
.
Compile
(
"
\\
<[
\\
S
\\
s]+?
\\
>"
)
src
=
re
.
ReplaceAllString
(
src
,
"
\n
"
)
html
=
re
.
ReplaceAllString
(
html
,
"
\n
"
)
re
,
_
=
regexp
.
Compile
(
"
\\
s{2,}"
)
src
=
re
.
ReplaceAllString
(
src
,
"
\n
"
)
html
=
re
.
ReplaceAllString
(
html
,
"
\n
"
)
return
strings
.
TrimSpace
(
src
)
return
strings
.
TrimSpace
(
html
)
}
// DateFormat takes a time and a layout string and returns a string with the formatted date. Used by the template parser as "dateformat"
...
...
@@ -193,7 +192,7 @@ func Str2html(raw string) template.HTML {
}
// Htmlquote returns quoted html string.
func
Htmlquote
(
src
string
)
string
{
func
Htmlquote
(
text
string
)
string
{
//HTML编码为实体符号
/*
Encodes `text` for raw use in HTML.
...
...
@@ -201,8 +200,6 @@ func Htmlquote(src string) string {
'<'&">'
*/
text
:=
string
(
src
)
text
=
strings
.
Replace
(
text
,
"&"
,
"&"
,
-
1
)
// Must be done first!
text
=
strings
.
Replace
(
text
,
"<"
,
"<"
,
-
1
)
text
=
strings
.
Replace
(
text
,
">"
,
">"
,
-
1
)
...
...
@@ -216,7 +213,7 @@ func Htmlquote(src string) string {
}
// Htmlunquote returns unquoted html string.
func
Htmlunquote
(
src
string
)
string
{
func
Htmlunquote
(
text
string
)
string
{
//实体符号解释为HTML
/*
Decodes `text` that's HTML quoted.
...
...
@@ -227,7 +224,6 @@ func Htmlunquote(src string) string {
// strings.Replace(s, old, new, n)
// 在s字符串中,把old字符串替换为new字符串,n表示替换的次数,小于0表示全部替换
text
:=
string
(
src
)
text
=
strings
.
Replace
(
text
,
" "
,
" "
,
-
1
)
text
=
strings
.
Replace
(
text
,
"”"
,
"”"
,
-
1
)
text
=
strings
.
Replace
(
text
,
"“"
,
"“"
,
-
1
)
...
...
@@ -262,19 +258,17 @@ func URLFor(endpoint string, values ...interface{}) string {
}
// AssetsJs returns script tag with src string.
func
AssetsJs
(
src
string
)
template
.
HTML
{
text
:=
string
(
src
)
func
AssetsJs
(
text
string
)
template
.
HTML
{
text
=
"<script src=
\"
"
+
src
+
"
\"
></script>"
text
=
"<script src=
\"
"
+
text
+
"
\"
></script>"
return
template
.
HTML
(
text
)
}
// AssetsCSS returns stylesheet link tag with src string.
func
AssetsCSS
(
src
string
)
template
.
HTML
{
text
:=
string
(
src
)
func
AssetsCSS
(
text
string
)
template
.
HTML
{
text
=
"<link href=
\"
"
+
src
+
"
\"
rel=
\"
stylesheet
\"
/>"
text
=
"<link href=
\"
"
+
text
+
"
\"
rel=
\"
stylesheet
\"
/>"
return
template
.
HTML
(
text
)
}
...
...
utils/captcha/image.go
浏览文件 @
856fde28
...
...
@@ -474,7 +474,7 @@ func randomBrightness(c color.RGBA, max uint8) color.RGBA {
uint8
(
int
(
c
.
R
)
+
n
),
uint8
(
int
(
c
.
G
)
+
n
),
uint8
(
int
(
c
.
B
)
+
n
),
uint8
(
c
.
A
)
,
c
.
A
,
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录