File tree 2 files changed +4
-3
lines changed
pkg/networks/usernet/dnshosts 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ import (
32
32
"github.com/containers/gvisor-tap-vsock/pkg/types"
33
33
)
34
34
35
- func ExtractZones (hosts hostMap ) ( zones []types.Zone ) {
35
+ func ExtractZones (hosts hostMap ) []types.Zone {
36
36
list := make (map [string ]types.Zone )
37
37
38
38
for host := range hosts {
@@ -57,10 +57,11 @@ func ExtractZones(hosts hostMap) (zones []types.Zone) {
57
57
list [h .name ()] = zone
58
58
}
59
59
60
+ zones := make ([]types.Zone , 0 , len (list ))
60
61
for _ , zone := range list {
61
62
zones = append (zones , zone )
62
63
}
63
- return
64
+ return zones
64
65
}
65
66
66
67
type hostMap map [string ]string
Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ func Test_zoneHost(t *testing.T) {
94
94
}
95
95
}
96
96
97
- func Test_extractZones (t * testing.T ) {
97
+ func TestExtractZones (t * testing.T ) {
98
98
equalZones := func (za , zb []types.Zone ) bool {
99
99
find := func (list []types.Zone , name string ) (types.Zone , bool ) {
100
100
for _ , z := range list {
You can’t perform that action at this time.
0 commit comments