Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
f4834bbc
Unverified
Commit
f4834bbc
authored
Aug 21, 2018
by
Christoph Blecker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix golint command to only pass a single *.go file at a time
parent
5b663992
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
verify-golint.sh
hack/verify-golint.sh
+9
-4
No files found.
hack/verify-golint.sh
View file @
f4834bbc
...
@@ -71,10 +71,15 @@ errors=()
...
@@ -71,10 +71,15 @@ errors=()
not_failing
=()
not_failing
=()
for
p
in
"
${
all_packages
[@]
}
"
;
do
for
p
in
"
${
all_packages
[@]
}
"
;
do
# Run golint on package/*.go file explicitly to validate all go files
# Run golint on package/*.go file explicitly to validate all go files
# and not just the ones for the current platform.
# and not just the ones for the current platform. This also will ensure that
# Packages with a corresponding foo_test package will make golint fail
# _test.go files are linted.
# with a useless error. Just ignore that, see golang/lint#68.
# Generated files are ignored, and each file is passed through golint
failedLint
=
$(
golint
"
$p
"
/
*
.go 2>/dev/null
)
# individually, as if one file in the package contains a fatal error (such as
# a foo package with a corresponding foo_test package), golint seems to choke
# completely.
# Ref: https://github.com/kubernetes/kubernetes/pull/67675
# Ref: https://github.com/golang/lint/issues/68
failedLint
=
$(
ls
"
$p
"
/
*
.go | egrep
-v
"(zz_generated.*.go|generated.pb.go|generated.proto|types_swagger_doc_generated.go)"
| xargs
-L1
golint 2>/dev/null
)
array_contains
"
$p
"
"
${
failing_packages
[@]
}
"
&&
in_failing
=
$?
||
in_failing
=
$?
array_contains
"
$p
"
"
${
failing_packages
[@]
}
"
&&
in_failing
=
$?
||
in_failing
=
$?
if
[[
-n
"
${
failedLint
}
"
]]
&&
[[
"
${
in_failing
}
"
-ne
"0"
]]
;
then
if
[[
-n
"
${
failedLint
}
"
]]
&&
[[
"
${
in_failing
}
"
-ne
"0"
]]
;
then
errors+
=(
"
${
failedLint
}
"
)
errors+
=(
"
${
failedLint
}
"
)
...
...
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