Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-workhorse
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-workhorse
Commits
14cdbd60
Commit
14cdbd60
authored
Dec 18, 2015
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Relax argument type of handleDeployPage
parent
208403df
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
deploy_page.go
deploy_page.go
+2
-2
deploy_page_test.go
deploy_page_test.go
+4
-4
No files found.
deploy_page.go
View file @
14cdbd60
...
@@ -6,12 +6,12 @@ import (
...
@@ -6,12 +6,12 @@ import (
"path/filepath"
"path/filepath"
)
)
func
handleDeployPage
(
documentRoot
*
string
,
handler
http
.
Handler
Func
)
http
.
HandlerFunc
{
func
handleDeployPage
(
documentRoot
*
string
,
handler
http
.
Handler
)
http
.
HandlerFunc
{
return
func
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
return
func
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
deployPage
:=
filepath
.
Join
(
*
documentRoot
,
"index.html"
)
deployPage
:=
filepath
.
Join
(
*
documentRoot
,
"index.html"
)
data
,
err
:=
ioutil
.
ReadFile
(
deployPage
)
data
,
err
:=
ioutil
.
ReadFile
(
deployPage
)
if
err
!=
nil
{
if
err
!=
nil
{
handler
(
w
,
r
)
handler
.
ServeHTTP
(
w
,
r
)
return
return
}
}
...
...
deploy_page_test.go
View file @
14cdbd60
...
@@ -19,9 +19,9 @@ func TestIfNoDeployPageExist(t *testing.T) {
...
@@ -19,9 +19,9 @@ func TestIfNoDeployPageExist(t *testing.T) {
w
:=
httptest
.
NewRecorder
()
w
:=
httptest
.
NewRecorder
()
executed
:=
false
executed
:=
false
handleDeployPage
(
&
dir
,
func
(
_
http
.
ResponseWriter
,
_
*
http
.
Request
)
{
handleDeployPage
(
&
dir
,
http
.
HandlerFunc
(
func
(
_
http
.
ResponseWriter
,
_
*
http
.
Request
)
{
executed
=
true
executed
=
true
})(
w
,
nil
)
})
)
(
w
,
nil
)
if
!
executed
{
if
!
executed
{
t
.
Error
(
"The handler should get executed"
)
t
.
Error
(
"The handler should get executed"
)
}
}
...
@@ -40,9 +40,9 @@ func TestIfDeployPageExist(t *testing.T) {
...
@@ -40,9 +40,9 @@ func TestIfDeployPageExist(t *testing.T) {
w
:=
httptest
.
NewRecorder
()
w
:=
httptest
.
NewRecorder
()
executed
:=
false
executed
:=
false
handleDeployPage
(
&
dir
,
func
(
_
http
.
ResponseWriter
,
_
*
http
.
Request
)
{
handleDeployPage
(
&
dir
,
http
.
HandlerFunc
(
func
(
_
http
.
ResponseWriter
,
_
*
http
.
Request
)
{
executed
=
true
executed
=
true
})(
w
,
nil
)
})
)
(
w
,
nil
)
if
executed
{
if
executed
{
t
.
Error
(
"The handler should not get executed"
)
t
.
Error
(
"The handler should not get executed"
)
}
}
...
...
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