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
0711c328
Commit
0711c328
authored
Jul 20, 2018
by
astaxie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix the orm test
parent
0d0d87f6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
app.go
app.go
+2
-2
orm_test.go
orm/orm_test.go
+2
-2
No files found.
app.go
View file @
0711c328
...
@@ -117,7 +117,7 @@ func (app *App) Run(mws ...MiddleWare) {
...
@@ -117,7 +117,7 @@ func (app *App) Run(mws ...MiddleWare) {
app
.
Server
.
Addr
=
httpsAddr
app
.
Server
.
Addr
=
httpsAddr
if
BConfig
.
Listen
.
EnableHTTPS
||
BConfig
.
Listen
.
EnableMutualHTTPS
{
if
BConfig
.
Listen
.
EnableHTTPS
||
BConfig
.
Listen
.
EnableMutualHTTPS
{
go
func
()
{
go
func
()
{
time
.
Sleep
(
2
0
*
time
.
Microsecond
)
time
.
Sleep
(
100
0
*
time
.
Microsecond
)
if
BConfig
.
Listen
.
HTTPSPort
!=
0
{
if
BConfig
.
Listen
.
HTTPSPort
!=
0
{
httpsAddr
=
fmt
.
Sprintf
(
"%s:%d"
,
BConfig
.
Listen
.
HTTPSAddr
,
BConfig
.
Listen
.
HTTPSPort
)
httpsAddr
=
fmt
.
Sprintf
(
"%s:%d"
,
BConfig
.
Listen
.
HTTPSAddr
,
BConfig
.
Listen
.
HTTPSPort
)
app
.
Server
.
Addr
=
httpsAddr
app
.
Server
.
Addr
=
httpsAddr
...
@@ -163,7 +163,7 @@ func (app *App) Run(mws ...MiddleWare) {
...
@@ -163,7 +163,7 @@ func (app *App) Run(mws ...MiddleWare) {
// run normal mode
// run normal mode
if
BConfig
.
Listen
.
EnableHTTPS
||
BConfig
.
Listen
.
EnableMutualHTTPS
{
if
BConfig
.
Listen
.
EnableHTTPS
||
BConfig
.
Listen
.
EnableMutualHTTPS
{
go
func
()
{
go
func
()
{
time
.
Sleep
(
2
0
*
time
.
Microsecond
)
time
.
Sleep
(
100
0
*
time
.
Microsecond
)
if
BConfig
.
Listen
.
HTTPSPort
!=
0
{
if
BConfig
.
Listen
.
HTTPSPort
!=
0
{
app
.
Server
.
Addr
=
fmt
.
Sprintf
(
"%s:%d"
,
BConfig
.
Listen
.
HTTPSAddr
,
BConfig
.
Listen
.
HTTPSPort
)
app
.
Server
.
Addr
=
fmt
.
Sprintf
(
"%s:%d"
,
BConfig
.
Listen
.
HTTPSAddr
,
BConfig
.
Listen
.
HTTPSPort
)
}
else
if
BConfig
.
Listen
.
EnableHTTP
{
}
else
if
BConfig
.
Listen
.
EnableHTTP
{
...
...
orm/orm_test.go
View file @
0711c328
...
@@ -1008,13 +1008,13 @@ func TestAll(t *testing.T) {
...
@@ -1008,13 +1008,13 @@ func TestAll(t *testing.T) {
qs
=
dORM
.
QueryTable
(
"user"
)
qs
=
dORM
.
QueryTable
(
"user"
)
num
,
err
=
qs
.
Filter
(
"user_name"
,
"nothing"
)
.
All
(
&
users
)
num
,
err
=
qs
.
Filter
(
"user_name"
,
"nothing"
)
.
All
(
&
users
)
throwFailNow
(
t
,
err
)
throwFailNow
(
t
,
AssertIs
(
err
,
ErrNoRows
)
)
throwFailNow
(
t
,
AssertIs
(
num
,
0
))
throwFailNow
(
t
,
AssertIs
(
num
,
0
))
var
users3
[]
*
User
var
users3
[]
*
User
qs
=
dORM
.
QueryTable
(
"user"
)
qs
=
dORM
.
QueryTable
(
"user"
)
num
,
err
=
qs
.
Filter
(
"user_name"
,
"nothing"
)
.
All
(
&
users3
)
num
,
err
=
qs
.
Filter
(
"user_name"
,
"nothing"
)
.
All
(
&
users3
)
throwFailNow
(
t
,
err
)
throwFailNow
(
t
,
AssertIs
(
err
,
ErrNoRows
)
)
throwFailNow
(
t
,
AssertIs
(
num
,
0
))
throwFailNow
(
t
,
AssertIs
(
num
,
0
))
throwFailNow
(
t
,
AssertIs
(
users3
==
nil
,
false
))
throwFailNow
(
t
,
AssertIs
(
users3
==
nil
,
false
))
}
}
...
...
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