From 1af6f85ada141151d7af39213eaf17d199603c86 Mon Sep 17 00:00:00 2001 From: sam boyer Date: Mon, 2 Jul 2018 00:01:10 -0400 Subject: [PATCH] ci: Ignore main file in licenseok This should fix test failures that were being caused by golang/go#24570, which caused test binaries to be built even when there are no test files. The poor interaction there arose from the setting of flags in our init() function, it seems. --- Makefile | 2 +- hack/licenseok/main.go | 2 ++ hack/validate-licence.bash | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index a37104937d..797aaac0e1 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ build: cp ./release/dep-$(PLATFORM)-$(ARCH) dep licenseok: - go build ./hack/licenseok + go build -o licenseok ./hack/licenseok/main.go validate: build licenseok ./hack/lint.bash diff --git a/hack/licenseok/main.go b/hack/licenseok/main.go index 6f049c4bd1..9ef8fa8e2d 100644 --- a/hack/licenseok/main.go +++ b/hack/licenseok/main.go @@ -1,3 +1,5 @@ +// +build ignore + // Copyright 2017 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/hack/validate-licence.bash b/hack/validate-licence.bash index dcf1c7edac..17d0d42594 100755 --- a/hack/validate-licence.bash +++ b/hack/validate-licence.bash @@ -7,6 +7,6 @@ # source files to check licence set -e -go build ./hack/licenseok +go build -o licenseok ./hack/licenseok/main.go find . -path ./vendor -prune -o -regex ".+\.pb\.go$" -prune -o -type f -regex ".*\.\(go\|proto\)$"\ -printf '%P\n' | xargs ./licenseok