Run go vet on all code, not just pkg and cmd

pull/3841/head
Anders F Björklund 2019-03-10 14:33:24 +01:00
parent 0d8e591a4a
commit 6d96a67456
4 changed files with 5 additions and 8 deletions

View File

@ -1,3 +1,5 @@
// +build darwin
/*
Copyright 2016 The Kubernetes Authors All rights reserved.

View File

@ -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)

View File

@ -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
}

View File

@ -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)