mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-11 13:18:53 +00:00
all: cleanup unused code, part 1 (#10661)
Run `staticcheck` with `U1000` to find unused code. This cleans up about a half of it. I'll do the other half separately to keep PRs manageable. Updates #cleanup Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
This commit is contained in:
@@ -342,11 +342,11 @@ func getVal() *tailscaleTypes {
|
||||
}
|
||||
|
||||
type IntThenByte struct {
|
||||
i int
|
||||
b byte
|
||||
_ int
|
||||
_ byte
|
||||
}
|
||||
|
||||
type TwoInts struct{ a, b int }
|
||||
type TwoInts struct{ _, _ int }
|
||||
|
||||
type IntIntByteInt struct {
|
||||
i1, i2 int32
|
||||
@@ -355,7 +355,6 @@ type IntIntByteInt struct {
|
||||
}
|
||||
|
||||
func u8(n uint8) string { return string([]byte{n}) }
|
||||
func u16(n uint16) string { return string(binary.LittleEndian.AppendUint16(nil, n)) }
|
||||
func u32(n uint32) string { return string(binary.LittleEndian.AppendUint32(nil, n)) }
|
||||
func u64(n uint64) string { return string(binary.LittleEndian.AppendUint64(nil, n)) }
|
||||
func ux(n uint) string {
|
||||
|
@@ -78,7 +78,7 @@ func TestTypeIsMemHashable(t *testing.T) {
|
||||
|
||||
func TestTypeIsRecursive(t *testing.T) {
|
||||
type RecursiveStruct struct {
|
||||
v *RecursiveStruct
|
||||
_ *RecursiveStruct
|
||||
}
|
||||
type RecursiveChan chan *RecursiveChan
|
||||
|
||||
|
@@ -73,33 +73,3 @@ const (
|
||||
// The default is "user-decides" unless otherwise stated.
|
||||
PostureChecking Key = "PostureChecking"
|
||||
)
|
||||
|
||||
var stringKeys = []Key{
|
||||
ControlURL,
|
||||
LogTarget,
|
||||
Tailnet,
|
||||
ExitNodeID,
|
||||
ExitNodeIP,
|
||||
EnableIncomingConnections,
|
||||
EnableServerMode,
|
||||
ExitNodeAllowLANAccess,
|
||||
EnableTailscaleDNS,
|
||||
EnableTailscaleSubnets,
|
||||
AdminConsoleVisibility,
|
||||
NetworkDevicesVisibility,
|
||||
TestMenuVisibility,
|
||||
UpdateMenuVisibility,
|
||||
RunExitNodeVisibility,
|
||||
PreferencesMenuVisibility,
|
||||
ExitNodeMenuVisibility,
|
||||
AutoUpdateVisibility,
|
||||
KeyExpirationNoticeTime,
|
||||
PostureChecking,
|
||||
}
|
||||
|
||||
var boolKeys = []Key{
|
||||
LogSCMInteractions,
|
||||
FlushDNSOnSessionUnlock,
|
||||
}
|
||||
|
||||
var uint64Keys = []Key{}
|
||||
|
34
util/syspolicy/policy_keys_windows.go
Normal file
34
util/syspolicy/policy_keys_windows.go
Normal file
@@ -0,0 +1,34 @@
|
||||
// Copyright (c) Tailscale Inc & AUTHORS
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
package syspolicy
|
||||
|
||||
var stringKeys = []Key{
|
||||
ControlURL,
|
||||
LogTarget,
|
||||
Tailnet,
|
||||
ExitNodeID,
|
||||
ExitNodeIP,
|
||||
EnableIncomingConnections,
|
||||
EnableServerMode,
|
||||
ExitNodeAllowLANAccess,
|
||||
EnableTailscaleDNS,
|
||||
EnableTailscaleSubnets,
|
||||
AdminConsoleVisibility,
|
||||
NetworkDevicesVisibility,
|
||||
TestMenuVisibility,
|
||||
UpdateMenuVisibility,
|
||||
RunExitNodeVisibility,
|
||||
PreferencesMenuVisibility,
|
||||
ExitNodeMenuVisibility,
|
||||
AutoUpdateVisibility,
|
||||
KeyExpirationNoticeTime,
|
||||
PostureChecking,
|
||||
}
|
||||
|
||||
var boolKeys = []Key{
|
||||
LogSCMInteractions,
|
||||
FlushDNSOnSessionUnlock,
|
||||
}
|
||||
|
||||
var uint64Keys = []Key{}
|
Reference in New Issue
Block a user