feature/buildfeatures: split const bools out of the featuretags package, add Has prefix

This renames the package+symbols in the earlier 17ffa80138 to be
in their own package ("buildfeatures") and start with the word "Has"
like "if buildfeatures.HasFoo {".

Updates #12614

Change-Id: I510e5f65993e5b76a0e163e3aa4543755213cbf6
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
pull/17144/head
Brad Fitzpatrick 3 months ago committed by Brad Fitzpatrick
parent 510830ca7a
commit 6fb316f5ed

@ -0,0 +1,10 @@
// Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause
//go:generate go run gen.go
// The buildfeatures package contains boolean constants indicating which
// features were included in the binary (via build tags), for use in dead code
// elimination when using separate build tag protected files is impractical
// or undesirable.
package buildfeatures

@ -1,13 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS // Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen-featuretags.go; DO NOT EDIT. // Code generated by gen.go; DO NOT EDIT.
//go:build ts_omit_aws //go:build ts_omit_aws
package featuretags package buildfeatures
// AWS is whether the binary was built with support for modular feature "AWS integration". // HasAWS is whether the binary was built with support for modular feature "AWS integration".
// Specifically, it's whether the binary was NOT built with the "ts_omit_aws" build tag. // Specifically, it's whether the binary was NOT built with the "ts_omit_aws" build tag.
// It's a const so it can be used for dead code elimination. // It's a const so it can be used for dead code elimination.
const AWS = false const HasAWS = false

@ -1,13 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS // Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen-featuretags.go; DO NOT EDIT. // Code generated by gen.go; DO NOT EDIT.
//go:build !ts_omit_aws //go:build !ts_omit_aws
package featuretags package buildfeatures
// AWS is whether the binary was built with support for modular feature "AWS integration". // HasAWS is whether the binary was built with support for modular feature "AWS integration".
// Specifically, it's whether the binary was NOT built with the "ts_omit_aws" build tag. // Specifically, it's whether the binary was NOT built with the "ts_omit_aws" build tag.
// It's a const so it can be used for dead code elimination. // It's a const so it can be used for dead code elimination.
const AWS = true const HasAWS = true

@ -1,13 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS // Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen-featuretags.go; DO NOT EDIT. // Code generated by gen.go; DO NOT EDIT.
//go:build ts_omit_bird //go:build ts_omit_bird
package featuretags package buildfeatures
// Bird is whether the binary was built with support for modular feature "Bird BGP integration". // HasBird is whether the binary was built with support for modular feature "Bird BGP integration".
// Specifically, it's whether the binary was NOT built with the "ts_omit_bird" build tag. // Specifically, it's whether the binary was NOT built with the "ts_omit_bird" build tag.
// It's a const so it can be used for dead code elimination. // It's a const so it can be used for dead code elimination.
const Bird = false const HasBird = false

@ -1,13 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS // Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen-featuretags.go; DO NOT EDIT. // Code generated by gen.go; DO NOT EDIT.
//go:build !ts_omit_bird //go:build !ts_omit_bird
package featuretags package buildfeatures
// Bird is whether the binary was built with support for modular feature "Bird BGP integration". // HasBird is whether the binary was built with support for modular feature "Bird BGP integration".
// Specifically, it's whether the binary was NOT built with the "ts_omit_bird" build tag. // Specifically, it's whether the binary was NOT built with the "ts_omit_bird" build tag.
// It's a const so it can be used for dead code elimination. // It's a const so it can be used for dead code elimination.
const Bird = true const HasBird = true

@ -1,13 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS // Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen-featuretags.go; DO NOT EDIT. // Code generated by gen.go; DO NOT EDIT.
//go:build ts_omit_capture //go:build ts_omit_capture
package featuretags package buildfeatures
// Capture is whether the binary was built with support for modular feature "Packet capture". // HasCapture is whether the binary was built with support for modular feature "Packet capture".
// Specifically, it's whether the binary was NOT built with the "ts_omit_capture" build tag. // Specifically, it's whether the binary was NOT built with the "ts_omit_capture" build tag.
// It's a const so it can be used for dead code elimination. // It's a const so it can be used for dead code elimination.
const Capture = false const HasCapture = false

@ -1,13 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS // Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen-featuretags.go; DO NOT EDIT. // Code generated by gen.go; DO NOT EDIT.
//go:build !ts_omit_capture //go:build !ts_omit_capture
package featuretags package buildfeatures
// Capture is whether the binary was built with support for modular feature "Packet capture". // HasCapture is whether the binary was built with support for modular feature "Packet capture".
// Specifically, it's whether the binary was NOT built with the "ts_omit_capture" build tag. // Specifically, it's whether the binary was NOT built with the "ts_omit_capture" build tag.
// It's a const so it can be used for dead code elimination. // It's a const so it can be used for dead code elimination.
const Capture = true const HasCapture = true

@ -1,13 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS // Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen-featuretags.go; DO NOT EDIT. // Code generated by gen.go; DO NOT EDIT.
//go:build ts_omit_completion //go:build ts_omit_completion
package featuretags package buildfeatures
// Completion is whether the binary was built with support for modular feature "CLI shell completion". // HasCompletion is whether the binary was built with support for modular feature "CLI shell completion".
// Specifically, it's whether the binary was NOT built with the "ts_omit_completion" build tag. // Specifically, it's whether the binary was NOT built with the "ts_omit_completion" build tag.
// It's a const so it can be used for dead code elimination. // It's a const so it can be used for dead code elimination.
const Completion = false const HasCompletion = false

@ -1,13 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS // Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen-featuretags.go; DO NOT EDIT. // Code generated by gen.go; DO NOT EDIT.
//go:build !ts_omit_completion //go:build !ts_omit_completion
package featuretags package buildfeatures
// Completion is whether the binary was built with support for modular feature "CLI shell completion". // HasCompletion is whether the binary was built with support for modular feature "CLI shell completion".
// Specifically, it's whether the binary was NOT built with the "ts_omit_completion" build tag. // Specifically, it's whether the binary was NOT built with the "ts_omit_completion" build tag.
// It's a const so it can be used for dead code elimination. // It's a const so it can be used for dead code elimination.
const Completion = true const HasCompletion = true

@ -1,13 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS // Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen-featuretags.go; DO NOT EDIT. // Code generated by gen.go; DO NOT EDIT.
//go:build ts_omit_debugeventbus //go:build ts_omit_debugeventbus
package featuretags package buildfeatures
// DebugEventBus is whether the binary was built with support for modular feature "eventbus debug support". // HasDebugEventBus is whether the binary was built with support for modular feature "eventbus debug support".
// Specifically, it's whether the binary was NOT built with the "ts_omit_debugeventbus" build tag. // Specifically, it's whether the binary was NOT built with the "ts_omit_debugeventbus" build tag.
// It's a const so it can be used for dead code elimination. // It's a const so it can be used for dead code elimination.
const DebugEventBus = false const HasDebugEventBus = false

@ -1,13 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS // Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen-featuretags.go; DO NOT EDIT. // Code generated by gen.go; DO NOT EDIT.
//go:build !ts_omit_debugeventbus //go:build !ts_omit_debugeventbus
package featuretags package buildfeatures
// DebugEventBus is whether the binary was built with support for modular feature "eventbus debug support". // HasDebugEventBus is whether the binary was built with support for modular feature "eventbus debug support".
// Specifically, it's whether the binary was NOT built with the "ts_omit_debugeventbus" build tag. // Specifically, it's whether the binary was NOT built with the "ts_omit_debugeventbus" build tag.
// It's a const so it can be used for dead code elimination. // It's a const so it can be used for dead code elimination.
const DebugEventBus = true const HasDebugEventBus = true

@ -1,13 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS // Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen-featuretags.go; DO NOT EDIT. // Code generated by gen.go; DO NOT EDIT.
//go:build ts_omit_desktop_sessions //go:build ts_omit_desktop_sessions
package featuretags package buildfeatures
// DesktopSessions is whether the binary was built with support for modular feature "Desktop sessions support". // HasDesktopSessions is whether the binary was built with support for modular feature "Desktop sessions support".
// Specifically, it's whether the binary was NOT built with the "ts_omit_desktop_sessions" build tag. // Specifically, it's whether the binary was NOT built with the "ts_omit_desktop_sessions" build tag.
// It's a const so it can be used for dead code elimination. // It's a const so it can be used for dead code elimination.
const DesktopSessions = false const HasDesktopSessions = false

@ -1,13 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS // Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen-featuretags.go; DO NOT EDIT. // Code generated by gen.go; DO NOT EDIT.
//go:build !ts_omit_desktop_sessions //go:build !ts_omit_desktop_sessions
package featuretags package buildfeatures
// DesktopSessions is whether the binary was built with support for modular feature "Desktop sessions support". // HasDesktopSessions is whether the binary was built with support for modular feature "Desktop sessions support".
// Specifically, it's whether the binary was NOT built with the "ts_omit_desktop_sessions" build tag. // Specifically, it's whether the binary was NOT built with the "ts_omit_desktop_sessions" build tag.
// It's a const so it can be used for dead code elimination. // It's a const so it can be used for dead code elimination.
const DesktopSessions = true const HasDesktopSessions = true

@ -1,13 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS // Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen-featuretags.go; DO NOT EDIT. // Code generated by gen.go; DO NOT EDIT.
//go:build ts_omit_drive //go:build ts_omit_drive
package featuretags package buildfeatures
// Drive is whether the binary was built with support for modular feature "Tailscale Drive (file server) support". // HasDrive is whether the binary was built with support for modular feature "Tailscale Drive (file server) support".
// Specifically, it's whether the binary was NOT built with the "ts_omit_drive" build tag. // Specifically, it's whether the binary was NOT built with the "ts_omit_drive" build tag.
// It's a const so it can be used for dead code elimination. // It's a const so it can be used for dead code elimination.
const Drive = false const HasDrive = false

@ -1,13 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS // Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen-featuretags.go; DO NOT EDIT. // Code generated by gen.go; DO NOT EDIT.
//go:build !ts_omit_drive //go:build !ts_omit_drive
package featuretags package buildfeatures
// Drive is whether the binary was built with support for modular feature "Tailscale Drive (file server) support". // HasDrive is whether the binary was built with support for modular feature "Tailscale Drive (file server) support".
// Specifically, it's whether the binary was NOT built with the "ts_omit_drive" build tag. // Specifically, it's whether the binary was NOT built with the "ts_omit_drive" build tag.
// It's a const so it can be used for dead code elimination. // It's a const so it can be used for dead code elimination.
const Drive = true const HasDrive = true

@ -1,13 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS // Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen-featuretags.go; DO NOT EDIT. // Code generated by gen.go; DO NOT EDIT.
//go:build ts_omit_kube //go:build ts_omit_kube
package featuretags package buildfeatures
// Kube is whether the binary was built with support for modular feature "Kubernetes integration". // HasKube is whether the binary was built with support for modular feature "Kubernetes integration".
// Specifically, it's whether the binary was NOT built with the "ts_omit_kube" build tag. // Specifically, it's whether the binary was NOT built with the "ts_omit_kube" build tag.
// It's a const so it can be used for dead code elimination. // It's a const so it can be used for dead code elimination.
const Kube = false const HasKube = false

@ -1,13 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS // Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen-featuretags.go; DO NOT EDIT. // Code generated by gen.go; DO NOT EDIT.
//go:build !ts_omit_kube //go:build !ts_omit_kube
package featuretags package buildfeatures
// Kube is whether the binary was built with support for modular feature "Kubernetes integration". // HasKube is whether the binary was built with support for modular feature "Kubernetes integration".
// Specifically, it's whether the binary was NOT built with the "ts_omit_kube" build tag. // Specifically, it's whether the binary was NOT built with the "ts_omit_kube" build tag.
// It's a const so it can be used for dead code elimination. // It's a const so it can be used for dead code elimination.
const Kube = true const HasKube = true

@ -1,13 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS // Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen-featuretags.go; DO NOT EDIT. // Code generated by gen.go; DO NOT EDIT.
//go:build ts_omit_relayserver //go:build ts_omit_relayserver
package featuretags package buildfeatures
// RelayServer is whether the binary was built with support for modular feature "Relay server". // HasRelayServer is whether the binary was built with support for modular feature "Relay server".
// Specifically, it's whether the binary was NOT built with the "ts_omit_relayserver" build tag. // Specifically, it's whether the binary was NOT built with the "ts_omit_relayserver" build tag.
// It's a const so it can be used for dead code elimination. // It's a const so it can be used for dead code elimination.
const RelayServer = false const HasRelayServer = false

@ -1,13 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS // Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen-featuretags.go; DO NOT EDIT. // Code generated by gen.go; DO NOT EDIT.
//go:build !ts_omit_relayserver //go:build !ts_omit_relayserver
package featuretags package buildfeatures
// RelayServer is whether the binary was built with support for modular feature "Relay server". // HasRelayServer is whether the binary was built with support for modular feature "Relay server".
// Specifically, it's whether the binary was NOT built with the "ts_omit_relayserver" build tag. // Specifically, it's whether the binary was NOT built with the "ts_omit_relayserver" build tag.
// It's a const so it can be used for dead code elimination. // It's a const so it can be used for dead code elimination.
const RelayServer = true const HasRelayServer = true

@ -1,13 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS // Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen-featuretags.go; DO NOT EDIT. // Code generated by gen.go; DO NOT EDIT.
//go:build ts_omit_serve //go:build ts_omit_serve
package featuretags package buildfeatures
// Serve is whether the binary was built with support for modular feature "Serve and Funnel support". // HasServe is whether the binary was built with support for modular feature "Serve and Funnel support".
// Specifically, it's whether the binary was NOT built with the "ts_omit_serve" build tag. // Specifically, it's whether the binary was NOT built with the "ts_omit_serve" build tag.
// It's a const so it can be used for dead code elimination. // It's a const so it can be used for dead code elimination.
const Serve = false const HasServe = false

@ -1,13 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS // Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen-featuretags.go; DO NOT EDIT. // Code generated by gen.go; DO NOT EDIT.
//go:build !ts_omit_serve //go:build !ts_omit_serve
package featuretags package buildfeatures
// Serve is whether the binary was built with support for modular feature "Serve and Funnel support". // HasServe is whether the binary was built with support for modular feature "Serve and Funnel support".
// Specifically, it's whether the binary was NOT built with the "ts_omit_serve" build tag. // Specifically, it's whether the binary was NOT built with the "ts_omit_serve" build tag.
// It's a const so it can be used for dead code elimination. // It's a const so it can be used for dead code elimination.
const Serve = true const HasServe = true

@ -1,13 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS // Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen-featuretags.go; DO NOT EDIT. // Code generated by gen.go; DO NOT EDIT.
//go:build ts_omit_ssh //go:build ts_omit_ssh
package featuretags package buildfeatures
// SSH is whether the binary was built with support for modular feature "Tailscale SSH support". // HasSSH is whether the binary was built with support for modular feature "Tailscale SSH support".
// Specifically, it's whether the binary was NOT built with the "ts_omit_ssh" build tag. // Specifically, it's whether the binary was NOT built with the "ts_omit_ssh" build tag.
// It's a const so it can be used for dead code elimination. // It's a const so it can be used for dead code elimination.
const SSH = false const HasSSH = false

@ -1,13 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS // Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen-featuretags.go; DO NOT EDIT. // Code generated by gen.go; DO NOT EDIT.
//go:build !ts_omit_ssh //go:build !ts_omit_ssh
package featuretags package buildfeatures
// SSH is whether the binary was built with support for modular feature "Tailscale SSH support". // HasSSH is whether the binary was built with support for modular feature "Tailscale SSH support".
// Specifically, it's whether the binary was NOT built with the "ts_omit_ssh" build tag. // Specifically, it's whether the binary was NOT built with the "ts_omit_ssh" build tag.
// It's a const so it can be used for dead code elimination. // It's a const so it can be used for dead code elimination.
const SSH = true const HasSSH = true

@ -1,13 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS // Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen-featuretags.go; DO NOT EDIT. // Code generated by gen.go; DO NOT EDIT.
//go:build ts_omit_syspolicy //go:build ts_omit_syspolicy
package featuretags package buildfeatures
// SystemPolicy is whether the binary was built with support for modular feature "System policy configuration (MDM) support". // HasSystemPolicy is whether the binary was built with support for modular feature "System policy configuration (MDM) support".
// Specifically, it's whether the binary was NOT built with the "ts_omit_syspolicy" build tag. // Specifically, it's whether the binary was NOT built with the "ts_omit_syspolicy" build tag.
// It's a const so it can be used for dead code elimination. // It's a const so it can be used for dead code elimination.
const SystemPolicy = false const HasSystemPolicy = false

@ -1,13 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS // Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen-featuretags.go; DO NOT EDIT. // Code generated by gen.go; DO NOT EDIT.
//go:build !ts_omit_syspolicy //go:build !ts_omit_syspolicy
package featuretags package buildfeatures
// SystemPolicy is whether the binary was built with support for modular feature "System policy configuration (MDM) support". // HasSystemPolicy is whether the binary was built with support for modular feature "System policy configuration (MDM) support".
// Specifically, it's whether the binary was NOT built with the "ts_omit_syspolicy" build tag. // Specifically, it's whether the binary was NOT built with the "ts_omit_syspolicy" build tag.
// It's a const so it can be used for dead code elimination. // It's a const so it can be used for dead code elimination.
const SystemPolicy = true const HasSystemPolicy = true

@ -1,13 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS // Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen-featuretags.go; DO NOT EDIT. // Code generated by gen.go; DO NOT EDIT.
//go:build ts_omit_systray //go:build ts_omit_systray
package featuretags package buildfeatures
// SysTray is whether the binary was built with support for modular feature "Linux system tray". // HasSysTray is whether the binary was built with support for modular feature "Linux system tray".
// Specifically, it's whether the binary was NOT built with the "ts_omit_systray" build tag. // Specifically, it's whether the binary was NOT built with the "ts_omit_systray" build tag.
// It's a const so it can be used for dead code elimination. // It's a const so it can be used for dead code elimination.
const SysTray = false const HasSysTray = false

@ -1,13 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS // Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen-featuretags.go; DO NOT EDIT. // Code generated by gen.go; DO NOT EDIT.
//go:build !ts_omit_systray //go:build !ts_omit_systray
package featuretags package buildfeatures
// SysTray is whether the binary was built with support for modular feature "Linux system tray". // HasSysTray is whether the binary was built with support for modular feature "Linux system tray".
// Specifically, it's whether the binary was NOT built with the "ts_omit_systray" build tag. // Specifically, it's whether the binary was NOT built with the "ts_omit_systray" build tag.
// It's a const so it can be used for dead code elimination. // It's a const so it can be used for dead code elimination.
const SysTray = true const HasSysTray = true

@ -1,13 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS // Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen-featuretags.go; DO NOT EDIT. // Code generated by gen.go; DO NOT EDIT.
//go:build ts_omit_taildrop //go:build ts_omit_taildrop
package featuretags package buildfeatures
// Taildrop is whether the binary was built with support for modular feature "Taildrop (file sending) support". // HasTaildrop is whether the binary was built with support for modular feature "Taildrop (file sending) support".
// Specifically, it's whether the binary was NOT built with the "ts_omit_taildrop" build tag. // Specifically, it's whether the binary was NOT built with the "ts_omit_taildrop" build tag.
// It's a const so it can be used for dead code elimination. // It's a const so it can be used for dead code elimination.
const Taildrop = false const HasTaildrop = false

@ -1,13 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS // Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen-featuretags.go; DO NOT EDIT. // Code generated by gen.go; DO NOT EDIT.
//go:build !ts_omit_taildrop //go:build !ts_omit_taildrop
package featuretags package buildfeatures
// Taildrop is whether the binary was built with support for modular feature "Taildrop (file sending) support". // HasTaildrop is whether the binary was built with support for modular feature "Taildrop (file sending) support".
// Specifically, it's whether the binary was NOT built with the "ts_omit_taildrop" build tag. // Specifically, it's whether the binary was NOT built with the "ts_omit_taildrop" build tag.
// It's a const so it can be used for dead code elimination. // It's a const so it can be used for dead code elimination.
const Taildrop = true const HasTaildrop = true

@ -1,13 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS // Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen-featuretags.go; DO NOT EDIT. // Code generated by gen.go; DO NOT EDIT.
//go:build ts_omit_tailnetlock //go:build ts_omit_tailnetlock
package featuretags package buildfeatures
// TailnetLock is whether the binary was built with support for modular feature "Tailnet Lock support". // HasTailnetLock is whether the binary was built with support for modular feature "Tailnet Lock support".
// Specifically, it's whether the binary was NOT built with the "ts_omit_tailnetlock" build tag. // Specifically, it's whether the binary was NOT built with the "ts_omit_tailnetlock" build tag.
// It's a const so it can be used for dead code elimination. // It's a const so it can be used for dead code elimination.
const TailnetLock = false const HasTailnetLock = false

@ -1,13 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS // Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen-featuretags.go; DO NOT EDIT. // Code generated by gen.go; DO NOT EDIT.
//go:build !ts_omit_tailnetlock //go:build !ts_omit_tailnetlock
package featuretags package buildfeatures
// TailnetLock is whether the binary was built with support for modular feature "Tailnet Lock support". // HasTailnetLock is whether the binary was built with support for modular feature "Tailnet Lock support".
// Specifically, it's whether the binary was NOT built with the "ts_omit_tailnetlock" build tag. // Specifically, it's whether the binary was NOT built with the "ts_omit_tailnetlock" build tag.
// It's a const so it can be used for dead code elimination. // It's a const so it can be used for dead code elimination.
const TailnetLock = true const HasTailnetLock = true

@ -1,13 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS // Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen-featuretags.go; DO NOT EDIT. // Code generated by gen.go; DO NOT EDIT.
//go:build ts_omit_tap //go:build ts_omit_tap
package featuretags package buildfeatures
// Tap is whether the binary was built with support for modular feature "Experimental Layer 2 (ethernet) support". // HasTap is whether the binary was built with support for modular feature "Experimental Layer 2 (ethernet) support".
// Specifically, it's whether the binary was NOT built with the "ts_omit_tap" build tag. // Specifically, it's whether the binary was NOT built with the "ts_omit_tap" build tag.
// It's a const so it can be used for dead code elimination. // It's a const so it can be used for dead code elimination.
const Tap = false const HasTap = false

@ -1,13 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS // Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen-featuretags.go; DO NOT EDIT. // Code generated by gen.go; DO NOT EDIT.
//go:build !ts_omit_tap //go:build !ts_omit_tap
package featuretags package buildfeatures
// Tap is whether the binary was built with support for modular feature "Experimental Layer 2 (ethernet) support". // HasTap is whether the binary was built with support for modular feature "Experimental Layer 2 (ethernet) support".
// Specifically, it's whether the binary was NOT built with the "ts_omit_tap" build tag. // Specifically, it's whether the binary was NOT built with the "ts_omit_tap" build tag.
// It's a const so it can be used for dead code elimination. // It's a const so it can be used for dead code elimination.
const Tap = true const HasTap = true

@ -1,13 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS // Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen-featuretags.go; DO NOT EDIT. // Code generated by gen.go; DO NOT EDIT.
//go:build ts_omit_tpm //go:build ts_omit_tpm
package featuretags package buildfeatures
// TPM is whether the binary was built with support for modular feature "TPM support". // HasTPM is whether the binary was built with support for modular feature "TPM support".
// Specifically, it's whether the binary was NOT built with the "ts_omit_tpm" build tag. // Specifically, it's whether the binary was NOT built with the "ts_omit_tpm" build tag.
// It's a const so it can be used for dead code elimination. // It's a const so it can be used for dead code elimination.
const TPM = false const HasTPM = false

@ -1,13 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS // Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen-featuretags.go; DO NOT EDIT. // Code generated by gen.go; DO NOT EDIT.
//go:build !ts_omit_tpm //go:build !ts_omit_tpm
package featuretags package buildfeatures
// TPM is whether the binary was built with support for modular feature "TPM support". // HasTPM is whether the binary was built with support for modular feature "TPM support".
// Specifically, it's whether the binary was NOT built with the "ts_omit_tpm" build tag. // Specifically, it's whether the binary was NOT built with the "ts_omit_tpm" build tag.
// It's a const so it can be used for dead code elimination. // It's a const so it can be used for dead code elimination.
const TPM = true const HasTPM = true

@ -1,13 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS // Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen-featuretags.go; DO NOT EDIT. // Code generated by gen.go; DO NOT EDIT.
//go:build ts_omit_wakeonlan //go:build ts_omit_wakeonlan
package featuretags package buildfeatures
// WakeOnLAN is whether the binary was built with support for modular feature "Wake-on-LAN support". // HasWakeOnLAN is whether the binary was built with support for modular feature "Wake-on-LAN support".
// Specifically, it's whether the binary was NOT built with the "ts_omit_wakeonlan" build tag. // Specifically, it's whether the binary was NOT built with the "ts_omit_wakeonlan" build tag.
// It's a const so it can be used for dead code elimination. // It's a const so it can be used for dead code elimination.
const WakeOnLAN = false const HasWakeOnLAN = false

@ -1,13 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS // Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen-featuretags.go; DO NOT EDIT. // Code generated by gen.go; DO NOT EDIT.
//go:build !ts_omit_wakeonlan //go:build !ts_omit_wakeonlan
package featuretags package buildfeatures
// WakeOnLAN is whether the binary was built with support for modular feature "Wake-on-LAN support". // HasWakeOnLAN is whether the binary was built with support for modular feature "Wake-on-LAN support".
// Specifically, it's whether the binary was NOT built with the "ts_omit_wakeonlan" build tag. // Specifically, it's whether the binary was NOT built with the "ts_omit_wakeonlan" build tag.
// It's a const so it can be used for dead code elimination. // It's a const so it can be used for dead code elimination.
const WakeOnLAN = true const HasWakeOnLAN = true

@ -1,13 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS // Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen-featuretags.go; DO NOT EDIT. // Code generated by gen.go; DO NOT EDIT.
//go:build ts_omit_webclient //go:build ts_omit_webclient
package featuretags package buildfeatures
// WebClient is whether the binary was built with support for modular feature "Web client support". // HasWebClient is whether the binary was built with support for modular feature "Web client support".
// Specifically, it's whether the binary was NOT built with the "ts_omit_webclient" build tag. // Specifically, it's whether the binary was NOT built with the "ts_omit_webclient" build tag.
// It's a const so it can be used for dead code elimination. // It's a const so it can be used for dead code elimination.
const WebClient = false const HasWebClient = false

@ -1,13 +1,13 @@
// Copyright (c) Tailscale Inc & AUTHORS // Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
// Code generated by gen-featuretags.go; DO NOT EDIT. // Code generated by gen.go; DO NOT EDIT.
//go:build !ts_omit_webclient //go:build !ts_omit_webclient
package featuretags package buildfeatures
// WebClient is whether the binary was built with support for modular feature "Web client support". // HasWebClient is whether the binary was built with support for modular feature "Web client support".
// Specifically, it's whether the binary was NOT built with the "ts_omit_webclient" build tag. // Specifically, it's whether the binary was NOT built with the "ts_omit_webclient" build tag.
// It's a const so it can be used for dead code elimination. // It's a const so it can be used for dead code elimination.
const WebClient = true const HasWebClient = true

@ -3,7 +3,7 @@
//go:build ignore //go:build ignore
// The gen-featuretags.go program generates the feature_<feature>_enabled.go // The gens.go program generates the feature_<feature>_enabled.go
// and feature_<feature>_disabled.go files for each feature tag. // and feature_<feature>_disabled.go files for each feature tag.
package main package main
@ -20,7 +20,7 @@ import (
const header = `// Copyright (c) Tailscale Inc & AUTHORS const header = `// Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
// Code g|e|n|e|r|a|t|e|d by gen-featuretags.go; D|O N|OT E|D|I|T. // Code g|e|n|e|r|a|t|e|d by gen.go; D|O N|OT E|D|I|T.
` `
@ -30,14 +30,14 @@ func main() {
if !k.IsOmittable() { if !k.IsOmittable() {
continue continue
} }
sym := cmp.Or(m.Sym, strings.ToUpper(string(k)[:1])+string(k)[1:]) sym := "Has" + cmp.Or(m.Sym, strings.ToUpper(string(k)[:1])+string(k)[1:])
for _, suf := range []string{"enabled", "disabled"} { for _, suf := range []string{"enabled", "disabled"} {
bang := "" bang := ""
if suf == "enabled" { if suf == "enabled" {
bang = "!" // !ts_omit_... bang = "!" // !ts_omit_...
} }
must.Do(os.WriteFile("feature_"+string(k)+"_"+suf+".go", must.Do(os.WriteFile("feature_"+string(k)+"_"+suf+".go",
fmt.Appendf(nil, "%s//go:build %s%s\n\npackage featuretags\n\n"+ fmt.Appendf(nil, "%s//go:build %s%s\n\npackage buildfeatures\n\n"+
"// %s is whether the binary was built with support for modular feature %q.\n"+ "// %s is whether the binary was built with support for modular feature %q.\n"+
"// Specifically, it's whether the binary was NOT built with the %q build tag.\n"+ "// Specifically, it's whether the binary was NOT built with the %q build tag.\n"+
"// It's a const so it can be used for dead code elimination.\n"+ "// It's a const so it can be used for dead code elimination.\n"+

@ -1,8 +1,6 @@
// Copyright (c) Tailscale Inc & AUTHORS // Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
//go:generate go run gen-featuretags.go
// The featuretags package is a registry of all the ts_omit-able build tags. // The featuretags package is a registry of all the ts_omit-able build tags.
package featuretags package featuretags

Loading…
Cancel
Save