summaryrefslogtreecommitdiff
path: root/pkg/network/network.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2020-06-11 14:40:38 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2020-06-15 07:05:56 -0400
commit200cfa41a434b7143620c2c252b3eb7ab3ef92f9 (patch)
treeccf0cb95297dc65d4dc8bd366963e2b037fb1a8b /pkg/network/network.go
parent3f026eb6a682a68e69f9376b72157a8f084e575c (diff)
downloadpodman-200cfa41a434b7143620c2c252b3eb7ab3ef92f9.tar.gz
podman-200cfa41a434b7143620c2c252b3eb7ab3ef92f9.tar.bz2
podman-200cfa41a434b7143620c2c252b3eb7ab3ef92f9.zip
Turn on More linters
- misspell - prealloc - unparam - nakedret Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'pkg/network/network.go')
-rw-r--r--pkg/network/network.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/network/network.go b/pkg/network/network.go
index 3ff664316..997aaf8a2 100644
--- a/pkg/network/network.go
+++ b/pkg/network/network.go
@@ -30,11 +30,11 @@ func IsSupportedDriver(driver string) error {
// GetLiveNetworks returns a slice of networks representing what the system
// has defined as network interfaces
func GetLiveNetworks() ([]*net.IPNet, error) {
- var nets []*net.IPNet
addrs, err := net.InterfaceAddrs()
if err != nil {
return nil, err
}
+ nets := make([]*net.IPNet, 0, len(addrs))
for _, address := range addrs {
_, n, err := net.ParseCIDR(address.String())
if err != nil {
@@ -47,11 +47,11 @@ func GetLiveNetworks() ([]*net.IPNet, error) {
// GetLiveNetworkNames returns a list of network interfaces on the system
func GetLiveNetworkNames() ([]string, error) {
- var interfaceNames []string
liveInterfaces, err := net.Interfaces()
if err != nil {
return nil, err
}
+ interfaceNames := make([]string, 0, len(liveInterfaces))
for _, i := range liveInterfaces {
interfaceNames = append(interfaceNames, i.Name)
}