From 6d96a67456bbcc2317d668ffee57e486af3ab6e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20F=20Bj=C3=B6rklund?= Date: Sun, 10 Mar 2019 14:33:24 +0100 Subject: [PATCH] Run go vet on all code, not just pkg and cmd --- cmd/drivers/hyperkit/main.go | 2 ++ pkg/storage/storage_provisioner.go | 2 +- third_party/go9p/srv_conn.go | 3 --- third_party/go9p/ufs_linux.go | 6 ++---- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/cmd/drivers/hyperkit/main.go b/cmd/drivers/hyperkit/main.go index 010770af7d..5089b6e9ec 100644 --- a/cmd/drivers/hyperkit/main.go +++ b/cmd/drivers/hyperkit/main.go @@ -1,3 +1,5 @@ +// +build darwin + /* Copyright 2016 The Kubernetes Authors All rights reserved. diff --git a/pkg/storage/storage_provisioner.go b/pkg/storage/storage_provisioner.go index e669377fa0..a5d49f2466 100644 --- a/pkg/storage/storage_provisioner.go +++ b/pkg/storage/storage_provisioner.go @@ -99,7 +99,7 @@ func (p *hostPathProvisioner) Delete(volume *v1.PersistentVolume) error { return errors.New("identity annotation not found on PV") } if ann != string(p.identity) { - return &controller.IgnoredError{"identity annotation on PV does not match ours"} + return &controller.IgnoredError{Reason: "identity annotation on PV does not match ours"} } path := path.Join(p.pvDir, volume.Name) diff --git a/third_party/go9p/srv_conn.go b/third_party/go9p/srv_conn.go index 4f9e1bdc72..d043d27980 100644 --- a/third_party/go9p/srv_conn.go +++ b/third_party/go9p/srv_conn.go @@ -210,8 +210,6 @@ func (conn *Conn) send() { } } } - - panic("unreached") } func (conn *Conn) RemoteAddr() net.Addr { @@ -259,5 +257,4 @@ func (srv *Srv) StartListener(l net.Listener) error { srv.NewConn(c) } - return nil } diff --git a/third_party/go9p/ufs_linux.go b/third_party/go9p/ufs_linux.go index c2fd46ef8c..23d3d9e424 100644 --- a/third_party/go9p/ufs_linux.go +++ b/third_party/go9p/ufs_linux.go @@ -19,14 +19,12 @@ func atime(stat *syscall.Stat_t) time.Time { func isBlock(d os.FileInfo) bool { stat := d.Sys().(*syscall.Stat_t) return (stat.Mode & syscall.S_IFMT) == syscall.S_IFBLK - return true } // IsChar reports if the file is a character device func isChar(d os.FileInfo) bool { stat := d.Sys().(*syscall.Stat_t) return (stat.Mode & syscall.S_IFMT) == syscall.S_IFCHR - return true } func dir2Qid(d os.FileInfo) *Qid { @@ -42,11 +40,11 @@ func dir2Qid(d os.FileInfo) *Qid { func dir2Dir(path string, d os.FileInfo, dotu bool, upool Users) (*Dir, error) { if r := recover(); r != nil { fmt.Print("stat failed: ", r) - return nil, &os.PathError{"dir2Dir", path, nil} + return nil, &os.PathError{Op: "dir2Dir", Path: path, Err: nil} } sysif := d.Sys() if sysif == nil { - return nil, &os.PathError{"dir2Dir: sysif is nil", path, nil} + return nil, &os.PathError{Op: "dir2Dir: sysif is nil", Path: path, Err: nil} } sysMode := sysif.(*syscall.Stat_t)