From 665613ccd418a6d96d5bf55c3beff3128922bb1d Mon Sep 17 00:00:00 2001 From: Alexandr Morozov Date: Wed, 13 Aug 2014 14:38:20 +0400 Subject: [PATCH] Fix warnings from go vet Signed-off-by: Alexandr Morozov --- console/console.go | 2 +- mount/init.go | 2 +- netlink/netlink_linux_test.go | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/console/console.go b/console/console.go index c0d1fb04..346f537d 100644 --- a/console/console.go +++ b/console/console.go @@ -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 } diff --git a/mount/init.go b/mount/init.go index 7edea499..05ab334c 100644 --- a/mount/init.go +++ b/mount/init.go @@ -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) } } } diff --git a/netlink/netlink_linux_test.go b/netlink/netlink_linux_test.go index 2db511b1..086aee7f 100644 --- a/netlink/netlink_linux_test.go +++ b/netlink/netlink_linux_test.go @@ -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()) } }