From a60603bfa336c6221b094bd46aaa97f0d13a60e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Gronowski?= Date: Thu, 6 Feb 2025 18:33:56 +0100 Subject: [PATCH] hack/validate: Add gocompat MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Paweł Gronowski --- hack/validate/gocompat | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 hack/validate/gocompat diff --git a/hack/validate/gocompat b/hack/validate/gocompat new file mode 100755 index 0000000000..25ea4e053d --- /dev/null +++ b/hack/validate/gocompat @@ -0,0 +1,10 @@ +#!/usr/bin/env sh +set -e + +# This script verifies that all packages have the correct //go:build directives set. +# This is necessary because when our code is consumed as a dependency in "module mode", +# Go will implicitly generate a go.mod and assume "go1.16" language version if one +# doesn't exist. Starting with Go 1.21, this causes compilation errors for any code +# using features from newer Go versions. + +make -C ./internal/gocompat