diff --git a/hack/make/validate-lint b/hack/make/validate-lint index 74c0391732..14bf7d4c4a 100644 --- a/hack/make/validate-lint +++ b/hack/make/validate-lint @@ -2,116 +2,15 @@ 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 - api/client - api/client/ps - api/server - api/types - builder - builder/command - builder/parser - builder/parser/dumper - cliconfig - daemon - daemon/events - daemon/execdriver - daemon/execdriver/execdrivers - daemon/execdriver/lxc - daemon/execdriver/native - daemon/execdriver/native/template - daemon/execdriver/windows - daemon/graphdriver - daemon/graphdriver/aufs - daemon/graphdriver/devmapper - daemon/graphdriver/overlay - daemon/graphdriver/vfs - daemon/graphdriver/zfs - daemon/logger - daemon/logger/fluentd - daemon/logger/gelf - daemon/logger/journald - daemon/logger/jsonfilelog - daemon/logger/syslog - daemon/network - docker - dockerinit - graph - graph/tags - image - integration-cli - opts - pkg/archive - pkg/broadcastwriter - pkg/chrootarchive - pkg/directory - pkg/fileutils - pkg/graphdb - pkg/homedir - pkg/httputils - pkg/ioutils - pkg/jsonlog - pkg/jsonmessage - 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/stdcopy - pkg/streamformatter - pkg/stringid - pkg/stringutils - pkg/symlink - pkg/sysinfo - pkg/system - pkg/tailfile - pkg/tarsum - pkg/term - pkg/term/windows - pkg/timeoutconn - pkg/timeutils - pkg/tlsconfig - pkg/truncindex - pkg/urlutil - pkg/ulimit - pkg/units - pkg/useragent - pkg/version - registry - runconfig - trust - utils - volume - volume/local - volume/drivers -) +packages=( $(go list ./... 2> /dev/null | grep -vE "^github.com/docker/docker/vendor|^github.com/docker/docker/autogen" || true ) ) errors=() for p in "${packages[@]}"; do + # Remove the github.com/docker/docker/ prefix from listed package + package="${p#github.com/docker/docker/}" # 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) + failedLint=$(golint $package/*.go) if [ "$failedLint" ]; then errors+=( "$failedLint" ) fi diff --git a/integration-cli/checker/checker.go b/integration-cli/checker/checker.go index 88624421d6..45915c80f8 100644 --- a/integration-cli/checker/checker.go +++ b/integration-cli/checker/checker.go @@ -1,4 +1,4 @@ -// Checker provide Docker specific implementations of the go-check.Checker interface. +// Package checker provide Docker specific implementations of the go-check.Checker interface. package checker import ( diff --git a/pkg/archive/archive_windows.go b/pkg/archive/archive_windows.go index 2500785667..ea9316031b 100644 --- a/pkg/archive/archive_windows.go +++ b/pkg/archive/archive_windows.go @@ -25,7 +25,7 @@ func getWalkRoot(srcPath string, include string) string { return filepath.Join(srcPath, include) } -// canonicalTarNameForPath returns platform-specific filepath +// CanonicalTarNameForPath returns platform-specific filepath // to canonical posix-style path for tar archival. p is relative // path. func CanonicalTarNameForPath(p string) (string, error) { diff --git a/pkg/devicemapper/devmapper_log.go b/pkg/devicemapper/devmapper_log.go index f66a20884b..c71a6ecda9 100644 --- a/pkg/devicemapper/devmapper_log.go +++ b/pkg/devicemapper/devmapper_log.go @@ -11,8 +11,9 @@ import ( // Due to the way cgo works this has to be in a separate file, as devmapper.go has // definitions in the cgo block, which is incompatible with using "//export" +// DevmapperLogCallback exports the devmapper log callback for cgo. (?) //export DevmapperLogCallback -func DevmapperLogCallback(level C.int, file *C.char, line C.int, dm_errno_or_class C.int, message *C.char) { +func DevmapperLogCallback(level C.int, file *C.char, line C.int, dmErrnoOrClass C.int, message *C.char) { msg := C.GoString(message) if level < 7 { if strings.Contains(msg, "busy") { @@ -29,6 +30,6 @@ func DevmapperLogCallback(level C.int, file *C.char, line C.int, dm_errno_or_cla } if dmLogger != nil { - dmLogger.DMLog(int(level), C.GoString(file), int(line), int(dm_errno_or_class), msg) + dmLogger.DMLog(int(level), C.GoString(file), int(line), int(dmErrnoOrClass), msg) } }