Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3-cmds
Commits
19525e62
Commit
19525e62
authored
Jan 08, 2018
by
Steven Allen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix go vet errors
fixes #42
parent
4e1cdfb5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
4 deletions
+8
-4
executor.go
executor.go
+3
-1
http/apiprefix_test.go
http/apiprefix_test.go
+1
-1
http/client.go
http/client.go
+2
-0
http/config.go
http/config.go
+2
-2
No files found.
executor.go
View file @
19525e62
...
...
@@ -76,7 +76,9 @@ func (x *executor) Execute(req *Request, re ResponseEmitter, env Environment) (e
if
err
!=
nil
{
return
err
}
req
.
Context
,
_
=
context
.
WithTimeout
(
req
.
Context
,
timeout
)
var
cancel
func
()
req
.
Context
,
cancel
=
context
.
WithTimeout
(
req
.
Context
,
timeout
)
defer
cancel
()
}
if
cmd
.
PreRun
!=
nil
{
...
...
http/apiprefix_test.go
View file @
19525e62
...
...
@@ -38,7 +38,7 @@ func TestAPIPrefixHandler(t *testing.T) {
assert
:=
func
(
name
string
,
exp
,
real
interface
{})
{
if
exp
!=
real
{
t
.
Error
(
"expected %s to be %q, but got %q"
,
name
,
exp
,
real
)
t
.
Error
f
(
"expected %s to be %q, but got %q"
,
name
,
exp
,
real
)
}
else
{
t
.
Log
(
"ok:"
,
name
)
}
...
...
http/client.go
View file @
19525e62
...
...
@@ -175,12 +175,14 @@ func (c *client) Send(req *cmds.Request) (cmds.Response, error) {
httpRes
,
err
:=
c
.
httpClient
.
Do
(
httpReq
)
if
err
!=
nil
{
reqCancel
()
return
nil
,
err
}
// using the overridden JSON encoding in request
res
,
err
:=
parseResponse
(
httpRes
,
req
)
if
err
!=
nil
{
reqCancel
()
return
nil
,
err
}
...
...
http/config.go
View file @
19525e62
...
...
@@ -35,7 +35,7 @@ func NewServerConfig() *ServerConfig {
return
cfg
}
func
(
cfg
ServerConfig
)
AllowedOrigins
()
[]
string
{
func
(
cfg
*
ServerConfig
)
AllowedOrigins
()
[]
string
{
cfg
.
corsOptsRWMutex
.
RLock
()
defer
cfg
.
corsOptsRWMutex
.
RUnlock
()
return
cfg
.
corsOpts
.
AllowedOrigins
...
...
@@ -55,7 +55,7 @@ func (cfg *ServerConfig) AppendAllowedOrigins(origins ...string) {
cfg
.
corsOpts
.
AllowedOrigins
=
append
(
cfg
.
corsOpts
.
AllowedOrigins
,
origins
...
)
}
func
(
cfg
ServerConfig
)
AllowedMethods
()
[]
string
{
func
(
cfg
*
ServerConfig
)
AllowedMethods
()
[]
string
{
cfg
.
corsOptsRWMutex
.
RLock
()
defer
cfg
.
corsOptsRWMutex
.
RUnlock
()
return
[]
string
(
cfg
.
corsOpts
.
AllowedMethods
)
...
...
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