mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-11 21:27:31 +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:
@@ -4,7 +4,6 @@
|
||||
package tailcfg_test
|
||||
|
||||
import (
|
||||
"encoding"
|
||||
"encoding/json"
|
||||
"net/netip"
|
||||
"os"
|
||||
@@ -639,30 +638,6 @@ func TestNetInfoFields(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
type keyIn interface {
|
||||
String() string
|
||||
MarshalText() ([]byte, error)
|
||||
}
|
||||
|
||||
func testKey(t *testing.T, prefix string, in keyIn, out encoding.TextUnmarshaler) {
|
||||
got, err := in.MarshalText()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := out.UnmarshalText(got); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if s := in.String(); string(got) != s {
|
||||
t.Errorf("MarshalText = %q != String %q", got, s)
|
||||
}
|
||||
if !strings.HasPrefix(string(got), prefix) {
|
||||
t.Errorf("%q didn't start with prefix %q", got, prefix)
|
||||
}
|
||||
if reflect.ValueOf(out).Elem().Interface() != in {
|
||||
t.Errorf("mismatch after unmarshal")
|
||||
}
|
||||
}
|
||||
|
||||
func TestCloneUser(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
|
Reference in New Issue
Block a user