diff --git a/client/tailscale/required_version.go b/client/tailscale/required_version.go new file mode 100644 index 000000000..186e688d3 --- /dev/null +++ b/client/tailscale/required_version.go @@ -0,0 +1,12 @@ +// 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 !go1.18 +// +build !go1.18 + +package tailscale + +func init() { + you_need_Go_1_18_to_compile_Tailscale() +} diff --git a/client/tailscale/tailscale.go b/client/tailscale/tailscale.go index 74bf7e148..778c32655 100644 --- a/client/tailscale/tailscale.go +++ b/client/tailscale/tailscale.go @@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build go1.18 +// +build go1.18 + // Package tailscale contains Tailscale client code. package tailscale diff --git a/cmd/tailscaled/debug.go b/cmd/tailscaled/debug.go index e51111c90..d4e6df496 100644 --- a/cmd/tailscaled/debug.go +++ b/cmd/tailscaled/debug.go @@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build go1.18 +// +build go1.18 + package main import ( diff --git a/cmd/tailscaled/install_darwin.go b/cmd/tailscaled/install_darwin.go index 2a4132852..d5d076eb9 100644 --- a/cmd/tailscaled/install_darwin.go +++ b/cmd/tailscaled/install_darwin.go @@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build go1.18 +// +build go1.18 + package main import ( diff --git a/cmd/tailscaled/install_windows.go b/cmd/tailscaled/install_windows.go index 3350779d1..a1e12ee3f 100644 --- a/cmd/tailscaled/install_windows.go +++ b/cmd/tailscaled/install_windows.go @@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build go1.18 +// +build go1.18 + package main import ( diff --git a/cmd/tailscaled/proxy.go b/cmd/tailscaled/proxy.go index cbd6ab6e1..e0668fec8 100644 --- a/cmd/tailscaled/proxy.go +++ b/cmd/tailscaled/proxy.go @@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build go1.18 +// +build go1.18 + // HTTP proxy code package main diff --git a/cmd/tailscaled/required_version.go b/cmd/tailscaled/required_version.go new file mode 100644 index 000000000..540a4854c --- /dev/null +++ b/cmd/tailscaled/required_version.go @@ -0,0 +1,12 @@ +// 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 !go1.18 +// +build !go1.18 + +package main + +func init() { + you_need_Go_1_18_to_compile_Tailscale() +} diff --git a/cmd/tailscaled/tailscaled.go b/cmd/tailscaled/tailscaled.go index aa563b11a..5c3a8435e 100644 --- a/cmd/tailscaled/tailscaled.go +++ b/cmd/tailscaled/tailscaled.go @@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build go1.18 +// +build go1.18 + // The tailscaled program is the Tailscale client daemon. It's configured // and controlled via the tailscale CLI program. // diff --git a/cmd/tailscaled/tailscaled_bird.go b/cmd/tailscaled/tailscaled_bird.go index 2be2a1263..97f5d3f5c 100644 --- a/cmd/tailscaled/tailscaled_bird.go +++ b/cmd/tailscaled/tailscaled_bird.go @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build linux || darwin || freebsd || openbsd +//go:build go1.18 && (linux || darwin || freebsd || openbsd) +// +build go1.18 // +build linux darwin freebsd openbsd package main diff --git a/cmd/tailscaled/tailscaled_notwindows.go b/cmd/tailscaled/tailscaled_notwindows.go index 3e5855d77..ee0bd5f16 100644 --- a/cmd/tailscaled/tailscaled_notwindows.go +++ b/cmd/tailscaled/tailscaled_notwindows.go @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !windows -// +build !windows +//go:build !windows && go1.18 +// +build !windows,go1.18 package main // import "tailscale.com/cmd/tailscaled" diff --git a/cmd/tailscaled/tailscaled_windows.go b/cmd/tailscaled/tailscaled_windows.go index f017c9026..771a8b18f 100644 --- a/cmd/tailscaled/tailscaled_windows.go +++ b/cmd/tailscaled/tailscaled_windows.go @@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build go1.18 +// +build go1.18 + package main // import "tailscale.com/cmd/tailscaled" // TODO: check if administrator, like tswin does.