Files
tailscale/types/structs/structs.go
T
Simon Law f53a1c7ba4 util/linuxfw: correct swapped table and chain names in error message (#22878)
In nftables, when a chain was not found, Tailscale would report:

	chain mangle not found in table OUTPUT

for the OUTPUT chain in the mangle table.

This patch strikes that and reverses it.

It also adds types/structs.RequireKeyedLiterals to prevent this from
happening again to this struct.

Fixes #22877

Change-Id: I930b1c2d66dc658e0486400fd7dc2c93591c3984

Signed-off-by: Simon Law <[email protected]>
2026-12-04 11:21:24 -08:00

20 lines
863 B
Go

// Copyright (c) Tailscale Inc & contributors
// SPDX-License-Identifier: BSD-3-Clause
// Package structs contains types used to define structs with special behaviors.
package structs
// Incomparable is a zero-width incomparable type. If added as the
// first field in a struct, it marks that struct as not comparable
// (can't do == or be a map key) and usually doesn't add any width to
// the struct (unless the struct has only small fields).
//
// Be making a struct incomparable, you can prevent misuse (prevent
// people from using ==), but also you can shrink generated binaries,
// as the compiler can omit equality funcs from the binary.
type Incomparable [0]func()
// RequireKeyedLiterals is a zero-width type. As the first field in a struct,
// it forces its literals to specify the named key for each field value.
type RequireKeyedLiterals struct{}