Revert ".github/workflows: work around golang/go#51629"
This reverts commit 2a412ac9ee
.
Updates #4194
Change-Id: I0098b66b71d20bea301ca79058c1cdd201237dd0
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
pull/4406/head
parent
09c5c9eb83
commit
a49d8d5200
|
@ -1,18 +0,0 @@
|
||||||
#!/usr/bin/env sh
|
|
||||||
#
|
|
||||||
# This is a temporary hack to work around
|
|
||||||
# https://github.com/golang/go/issues/51629 , wherein the stringer
|
|
||||||
# generator doesn't work with generics.
|
|
||||||
#
|
|
||||||
# This script is the equivalent of `go generate ./...`, except that it
|
|
||||||
# only runs generate on packages that don't try to use stringer.
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
find . -name '*.go' | xargs grep -l go:generate | xargs -n1 dirname | sort -u | while read dir; do
|
|
||||||
if ! egrep "cmd/(stringer|cloner)" $dir/*.go; then
|
|
||||||
set -x
|
|
||||||
go generate -tags=hermetic $dir
|
|
||||||
set +x
|
|
||||||
fi
|
|
||||||
done
|
|
|
@ -25,13 +25,14 @@ jobs:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: check 'go generate' is clean
|
- name: check 'go generate' is clean
|
||||||
# The shell script invocation below is a temporary hack for
|
|
||||||
# https://github.com/tailscale/tailscale/issues/4194. When
|
|
||||||
# that issue is fixed, replace its invocation with:
|
|
||||||
# go generate --tags=hermetic ./...
|
|
||||||
run: |
|
run: |
|
||||||
set -e
|
if [[ "${{github.ref}}" == release-branch/* ]]
|
||||||
./.github/workflows/go-generate-without-stringer.sh
|
then
|
||||||
|
pkgs=$(go list ./... | grep -v dnsfallback)
|
||||||
|
else
|
||||||
|
pkgs=$(go list ./... | grep -v dnsfallback)
|
||||||
|
fi
|
||||||
|
go generate $pkgs
|
||||||
echo
|
echo
|
||||||
echo
|
echo
|
||||||
git diff --name-only --exit-code || (echo "The files above need updating. Please run 'go generate'."; exit 1)
|
git diff --name-only --exit-code || (echo "The files above need updating. Please run 'go generate'."; exit 1)
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
//go:generate go run update-dns-fallbacks.go
|
||||||
|
|
||||||
// Package dnsfallback contains a DNS fallback mechanism
|
// Package dnsfallback contains a DNS fallback mechanism
|
||||||
// for starting up Tailscale when the system DNS is broken or otherwise unavailable.
|
// for starting up Tailscale when the system DNS is broken or otherwise unavailable.
|
||||||
package dnsfallback
|
package dnsfallback
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
// Copyright (c) 2022 Tailscale Inc & AUTHORS All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
//go:build !hermetic
|
|
||||||
// +build !hermetic
|
|
||||||
|
|
||||||
package dnsfallback
|
|
||||||
|
|
||||||
//go:generate go run update-dns-fallbacks.go
|
|
Loading…
Reference in New Issue