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
ai3
accountserver
Commits
da2e38da
Commit
da2e38da
authored
Nov 09, 2018
by
ale
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix lint warnings
parent
28476a76
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
validators.go
validators.go
+8
-3
No files found.
validators.go
View file @
da2e38da
...
...
@@ -281,7 +281,8 @@ func (v *validationContext) isAvailableEmailAddr() ValidatorFunc {
if
err
!=
nil
{
return
err
}
if
ok
,
_
:=
tx
.
HasAnyResource
(
ctx
,
rel
);
ok
{
// Errors will cause to consider the address unavailable.
if
ok
,
_
:=
tx
.
HasAnyResource
(
ctx
,
rel
);
ok
{
// nolint
return
errors
.
New
(
"address unavailable"
)
}
return
nil
...
...
@@ -298,7 +299,8 @@ func (v *validationContext) isAvailableDomain() ValidatorFunc {
if
err
!=
nil
{
return
err
}
if
ok
,
_
:=
tx
.
HasAnyResource
(
ctx
,
rel
);
ok
{
// Errors will cause to consider the resource unavailable.
if
ok
,
_
:=
tx
.
HasAnyResource
(
ctx
,
rel
);
ok
{
// nolint
return
errors
.
New
(
"address unavailable"
)
}
return
nil
...
...
@@ -315,7 +317,8 @@ func (v *validationContext) isAvailableWebsite() ValidatorFunc {
if
err
!=
nil
{
return
err
}
if
ok
,
_
:=
tx
.
HasAnyResource
(
ctx
,
rel
);
ok
{
// Errors will cause to consider the resource unavailable.
if
ok
,
_
:=
tx
.
HasAnyResource
(
ctx
,
rel
);
ok
{
// nolint
return
errors
.
New
(
"address unavailable"
)
}
return
nil
...
...
@@ -365,6 +368,8 @@ func allOf(funcs ...ValidatorFunc) ValidatorFunc {
// various fields in a Resource, depending on its type.
type
ResourceValidatorFunc
func
(
context
.
Context
,
*
Resource
,
*
User
)
error
// The linter thinks this function is too complex.
// nolint: gocyclo
func
(
v
*
validationContext
)
validateResource
(
_
context
.
Context
,
r
*
Resource
,
user
*
User
)
error
{
// Resource name must match the name in the resource ID
// (until we get rid of the Name field).
...
...
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