mantle: clean up platform/local/flight
This cleans up platform/local/flight.go.
Fixes part of
package local
import (
- "sync/atomic"
-
"github.com/vishvananda/netns"
"github.com/coreos/mantle/lang/destructor"
@@ -67,7 +65,9 @@ func NewLocalFlight(opts *platform.Options, platformName platform.Name) (*LocalF
lf.Destroy()
return nil, err
}
- defer nsExit()
+ defer func() {
+ _ = nsExit()
+ }()
lf.Dnsmasq, err = NewDnsmasq()
if err != nil {
@@ -105,10 +105,6 @@ func (lf *LocalFlight) NewCluster(rconf *platform.RuntimeConfig) (*LocalCluster,
return lc, nil
}
-func (lf *LocalFlight) newListenPort() int {
- return int(atomic.AddInt32(&lf.listenPort, 1))
-}
-
func (lf *LocalFlight) Destroy() {
lf.MultiDestructor.Destroy()
}
