mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-25 19:15:34 +00:00
portlist: unexport SameInodes method
Signed-off-by: Brad Fitzpatrick <brad@danga.com>
This commit is contained in:
parent
3167e55ddf
commit
5c5acadb2a
@ -81,7 +81,7 @@ func (p *Poller) Run(ctx context.Context) error {
|
|||||||
p.Err = err
|
p.Err = err
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if pl.SameInodes(p.prev) {
|
if pl.sameInodes(p.prev) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
p.prev = pl
|
p.prev = pl
|
||||||
|
@ -48,7 +48,7 @@ func (a *Port) lessThan(b *Port) bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a List) SameInodes(b List) bool {
|
func (a List) sameInodes(b List) bool {
|
||||||
if a == nil || b == nil || len(a) != len(b) {
|
if a == nil || b == nil || len(a) != len(b) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@ -76,7 +76,7 @@ func GetList(prev List) (List, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("listPorts: %s", err)
|
return nil, fmt.Errorf("listPorts: %s", err)
|
||||||
}
|
}
|
||||||
if pl.SameInodes(prev) {
|
if pl.sameInodes(prev) {
|
||||||
// Nothing changed, skip inode lookup
|
// Nothing changed, skip inode lookup
|
||||||
return prev, nil
|
return prev, nil
|
||||||
}
|
}
|
||||||
|
@ -185,7 +185,7 @@ func TestSameInodes(t *testing.T) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
got := tt.a.SameInodes(tt.b)
|
got := tt.a.sameInodes(tt.b)
|
||||||
if got != tt.want {
|
if got != tt.want {
|
||||||
t.Errorf("%s: Equal = %v; want %v", tt.name, got, tt.want)
|
t.Errorf("%s: Equal = %v; want %v", tt.name, got, tt.want)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user