mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-14 06:57:31 +00:00
util/mak: delete long-deprecated, unused, pre-generics NonNil func
Updates #5590 (which deprecated it, 2.5 years ago) Change-Id: I137e82855ee33d91e5639b909f7ca64e237ed6ba Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:

committed by
Brad Fitzpatrick

parent
8b72dd7873
commit
f468919f95
@@ -40,35 +40,6 @@ func TestSet(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
func TestNonNil(t *testing.T) {
|
||||
var s []string
|
||||
NonNil(&s)
|
||||
if len(s) != 0 {
|
||||
t.Errorf("slice len = %d; want 0", len(s))
|
||||
}
|
||||
if s == nil {
|
||||
t.Error("slice still nil")
|
||||
}
|
||||
|
||||
s = append(s, "foo")
|
||||
NonNil(&s)
|
||||
if len(s) != 1 {
|
||||
t.Errorf("len = %d; want 1", len(s))
|
||||
}
|
||||
if s[0] != "foo" {
|
||||
t.Errorf("value = %q; want foo", s)
|
||||
}
|
||||
|
||||
var m map[string]string
|
||||
NonNil(&m)
|
||||
if len(m) != 0 {
|
||||
t.Errorf("map len = %d; want 0", len(s))
|
||||
}
|
||||
if m == nil {
|
||||
t.Error("map still nil")
|
||||
}
|
||||
}
|
||||
|
||||
func TestNonNilMapForJSON(t *testing.T) {
|
||||
type M map[string]int
|
||||
var m M
|
||||
|
Reference in New Issue
Block a user