浏览代码

golangci-lint: set correct build-tags to lint journald if supported

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn 5 年之前
父节点
当前提交
d1363f5a90
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      hack/validate/golangci-lint

+ 7 - 0
hack/validate/golangci-lint

@@ -10,6 +10,13 @@ SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 
 
 [ -n "${TESTDEBUG}" ] && set -x
 [ -n "${TESTDEBUG}" ] && set -x
 
 
+# TODO find a way to share this code with hack/make.sh
+if ${PKG_CONFIG} 'libsystemd >= 209' 2> /dev/null ; then
+	DOCKER_BUILDTAGS+=" journald"
+elif ${PKG_CONFIG} 'libsystemd-journal' 2> /dev/null ; then
+	DOCKER_BUILDTAGS+=" journald journald_compat"
+fi
+
 # TODO use --out-format=junit-xml and store artifacts
 # TODO use --out-format=junit-xml and store artifacts
 GOGC=20 golangci-lint run \
 GOGC=20 golangci-lint run \
 	${GOLANGCI_LINT_OPTS} \
 	${GOLANGCI_LINT_OPTS} \