Add linters and fix lint issues

This commit is contained in:
Quentin McGaw
2020-10-20 02:45:28 +00:00
parent f9bef8ecda
commit 9c73faaaeb
107 changed files with 739 additions and 422 deletions

View File

@@ -8,7 +8,7 @@ import (
"golang.org/x/sys/unix"
)
// CheckTUN checks the tunnel device is present and accessible
// CheckTUN checks the tunnel device is present and accessible.
func (c *configurator) CheckTUN() error {
c.logger.Info("checking for device %s", constants.TunnelDevice)
f, err := c.openFile(string(constants.TunnelDevice), os.O_RDWR, 0)
@@ -26,7 +26,11 @@ func (c *configurator) CreateTUN() error {
if err := c.fileManager.CreateDir("/dev/net"); err != nil {
return err
}
dev := c.mkDev(10, 200)
const (
major = 10
minor = 200
)
dev := c.mkDev(major, minor)
if err := c.mkNod(string(constants.TunnelDevice), unix.S_IFCHR, int(dev)); err != nil {
return err
}