mirror of
https://github.com/tailscale/tailscale.git
synced 2025-10-10 18:41:40 +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:
@@ -7,7 +7,6 @@ import (
|
||||
"flag"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
@@ -36,13 +35,6 @@ func TestFindModuleInfo(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func exe() string {
|
||||
if runtime.GOOS == "windows" {
|
||||
return ".exe"
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var findModuleInfoName = flag.String("module-info-file", "", "if non-empty, test findModuleInfo against this filename")
|
||||
|
||||
func TestFindModuleInfoManual(t *testing.T) {
|
||||
|
@@ -40,8 +40,6 @@ func OS() string {
|
||||
return runtime.GOOS
|
||||
}
|
||||
|
||||
var isSandboxedMacOS lazy.SyncValue[bool]
|
||||
|
||||
// IsSandboxedMacOS reports whether this process is a sandboxed macOS
|
||||
// process (either the app or the extension). It is true for the Mac App Store
|
||||
// and macsys (System Extension) version on macOS, and false for
|
||||
@@ -210,15 +208,17 @@ var getMeta lazy.SyncValue[Meta]
|
||||
|
||||
// GetMeta returns version metadata about the current build.
|
||||
func GetMeta() Meta {
|
||||
return Meta{
|
||||
MajorMinorPatch: majorMinorPatch(),
|
||||
Short: Short(),
|
||||
Long: Long(),
|
||||
GitCommit: gitCommit(),
|
||||
GitDirty: gitDirty(),
|
||||
ExtraGitCommit: extraGitCommitStamp,
|
||||
IsDev: isDev(),
|
||||
UnstableBranch: IsUnstableBuild(),
|
||||
Cap: int(tailcfg.CurrentCapabilityVersion),
|
||||
}
|
||||
return getMeta.Get(func() Meta {
|
||||
return Meta{
|
||||
MajorMinorPatch: majorMinorPatch(),
|
||||
Short: Short(),
|
||||
Long: Long(),
|
||||
GitCommit: gitCommit(),
|
||||
GitDirty: gitDirty(),
|
||||
ExtraGitCommit: extraGitCommitStamp,
|
||||
IsDev: isDev(),
|
||||
UnstableBranch: IsUnstableBuild(),
|
||||
Cap: int(tailcfg.CurrentCapabilityVersion),
|
||||
}
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user