mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
6a274e48dc
golint fixes for daemon/logger/*
110 lines
2 KiB
Bash
110 lines
2 KiB
Bash
#!/bin/bash
|
|
|
|
source "${MAKEDIR}/.validate"
|
|
|
|
# We will eventually get to the point when packages should be the complete list
|
|
# of subpackages, vendoring excluded, as given by:
|
|
#
|
|
# packages=( $(go list ./... 2> /dev/null | grep -vE "^github.com/docker/docker/vendor" || true ) )
|
|
|
|
packages=(
|
|
api/server
|
|
api/client
|
|
api/client/ps
|
|
builder
|
|
builder/command
|
|
builder/parser
|
|
builder/parser/dumper
|
|
daemon/events
|
|
daemon/execdriver
|
|
daemon/execdriver/execdrivers
|
|
daemon/execdriver/lxc
|
|
daemon/execdriver/native/template
|
|
daemon/graphdriver/aufs
|
|
daemon/graphdriver/devmapper
|
|
daemon/logger
|
|
daemon/logger/fluentd
|
|
daemon/logger/gelf
|
|
daemon/logger/journald
|
|
daemon/logger/jsonfilelog
|
|
daemon/logger/syslog
|
|
daemon/network
|
|
docker
|
|
dockerinit
|
|
graph
|
|
image
|
|
integration-cli
|
|
pkg/chrootarchive
|
|
pkg/directory
|
|
pkg/fileutils
|
|
pkg/homedir
|
|
pkg/listenbuffer
|
|
pkg/mflag
|
|
pkg/mflag/example
|
|
pkg/mount
|
|
pkg/namesgenerator
|
|
pkg/nat
|
|
pkg/parsers
|
|
pkg/parsers/filters
|
|
pkg/parsers/kernel
|
|
pkg/parsers/operatingsystem
|
|
pkg/pidfile
|
|
pkg/plugins
|
|
pkg/pools
|
|
pkg/progressreader
|
|
pkg/promise
|
|
pkg/proxy
|
|
pkg/pubsub
|
|
pkg/random
|
|
pkg/reexec
|
|
pkg/signal
|
|
pkg/sockets
|
|
pkg/streamformatter
|
|
pkg/stringid
|
|
pkg/stringutils
|
|
pkg/systemd
|
|
pkg/symlink
|
|
pkg/tailfile
|
|
pkg/tarsum
|
|
pkg/term
|
|
pkg/timeoutconn
|
|
pkg/timeutils
|
|
pkg/tlsconfig
|
|
pkg/truncindex
|
|
pkg/urlutil
|
|
pkg/ulimit
|
|
pkg/units
|
|
pkg/useragent
|
|
pkg/version
|
|
registry
|
|
runconfig
|
|
utils
|
|
volume
|
|
volume/local
|
|
volume/drivers
|
|
)
|
|
|
|
errors=()
|
|
for p in "${packages[@]}"; do
|
|
# Run golint on package/*.go file explicitly to validate all go files
|
|
# and not just the ones for the current platform.
|
|
failedLint=$(golint "$p"/*.go)
|
|
if [ "$failedLint" ]; then
|
|
errors+=( "$failedLint" )
|
|
fi
|
|
done
|
|
|
|
if [ ${#errors[@]} -eq 0 ]; then
|
|
echo 'Congratulations! All Go source files have been linted.'
|
|
else
|
|
{
|
|
echo "Errors from golint:"
|
|
for err in "${errors[@]}"; do
|
|
echo "$err"
|
|
done
|
|
echo
|
|
echo 'Please fix the above errors. You can test via "golint" and commit the result.'
|
|
echo
|
|
} >&2
|
|
false
|
|
fi
|