Fix warnings from go vet

Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
This commit is contained in:
Alexandr Morozov 2014-08-13 14:38:20 +04:00
parent 1befa2fe9e
commit 665613ccd4
No known key found for this signature in database
GPG Key ID: 59BF89FA47378873
3 changed files with 4 additions and 4 deletions

View File

@ -114,7 +114,7 @@ func OpenPtmx() (*os.File, error) {
func OpenTerminal(name string, flag int) (*os.File, error) {
r, e := syscall.Open(name, flag, 0)
if e != nil {
return nil, &os.PathError{"open", name, e}
return nil, &os.PathError{Op: "open", Path: name, Err: e}
}
return os.NewFile(uintptr(r), name), nil
}

View File

@ -236,7 +236,7 @@ func reOpenDevNull(rootfs string) error {
if stat.Rdev == devNullStat.Rdev {
// Close and re-open the fd.
if err = syscall.Dup2(int(file.Fd()), fd); err != nil {
return fmt.Errorf("Failed to dup fd %d to fd %d - %s", file.Fd(), fd)
return fmt.Errorf("Failed to dup fd %d to fd %d - %s", file.Fd(), fd, err)
}
}
}

View File

@ -27,7 +27,7 @@ func TestAddDelNetworkIp(t *testing.T) {
ifaceName := "lo"
ip := net.ParseIP("127.0.1.1")
mask := net.IPv4Mask(255, 255, 255, 255)
ipNet := &net.IPNet{ip, mask}
ipNet := &net.IPNet{IP: ip, Mask: mask}
iface, err := net.InterfaceByName(ifaceName)
if err != nil {
@ -47,7 +47,7 @@ func TestAddDelNetworkIp(t *testing.T) {
}
if ipAssigned(iface, ip) {
t.Fatal("Located address '%s' in lo address list after removal.", ip.String())
t.Fatalf("Located address '%s' in lo address list after removal.", ip.String())
}
}