Skip to content

Commit

Permalink
Easy go vet fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
rgooch committed Feb 27, 2019
1 parent 53bd094 commit ad06fae
Show file tree
Hide file tree
Showing 11 changed files with 2 additions and 12 deletions.
2 changes: 1 addition & 1 deletion cmd/dominator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func main() {
logger.Fatalln(err)
}
}
rlim := syscall.Rlimit{*fdLimit, *fdLimit}
rlim := syscall.Rlimit{Cur: *fdLimit, Max: *fdLimit}
if err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim); err != nil {
fmt.Fprintf(os.Stderr, "Cannot set FD limit\t%s\n", err)
os.Exit(1)
Expand Down
2 changes: 0 additions & 2 deletions cmd/hyper-control/getUpdates.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ func getUpdatesOnFleetManager(fleetManager string,
return err
}
}
return nil
}

func getUpdatesOnHypervisor(hypervisor string, logger log.DebugLogger) error {
Expand All @@ -94,5 +93,4 @@ func getUpdatesOnHypervisor(hypervisor string, logger log.DebugLogger) error {
return err
}
}
return nil
}
1 change: 0 additions & 1 deletion cmd/hyper-control/installerShell.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,4 @@ func installerShell(hostname string, logger log.DebugLogger) error {
}
}
}
return nil
}
1 change: 0 additions & 1 deletion cmd/vm-control/traceMetadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ func doTraceMetadata(client *srpc.Client, ipAddr net.IP,
logger.Print(line)
}
}
return nil
}

func maybeWatchVm(client *srpc.Client, hypervisor string, ipAddr net.IP,
Expand Down
1 change: 0 additions & 1 deletion dom/herd/sub.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ func (sub *Sub) processFileUpdates() bool {
return haveUpdates
}
}
return haveUpdates
}

func (sub *Sub) poll(srpcClient *srpc.Client, previousStatus subStatus) {
Expand Down
1 change: 0 additions & 1 deletion hypervisor/manager/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -1814,7 +1814,6 @@ func (m *Manager) startVm(ipAddr net.IP, authInfo *srpc.AuthInformation,
default:
return false, errors.New("unknown state: " + vm.State.String())
}
return false, nil
}

func (m *Manager) stopVm(ipAddr net.IP, authInfo *srpc.AuthInformation,
Expand Down
1 change: 0 additions & 1 deletion lib/filesystem/untar/decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ func (decoderData *decoderData) addHeader(tarReader *tar.Reader, hasher Hasher,
return errors.New(fmt.Sprintf("Unsupported file type: %v",
header.Typeflag))
}
return nil
}

func (decoderData *decoderData) addRegularFile(tarReader *tar.Reader,
Expand Down
1 change: 0 additions & 1 deletion lib/fsutil/watchFile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,5 +112,4 @@ func watchTimeout(channel <-chan io.ReadCloser, timeout time.Duration) (
case <-time.After(timeout):
return nil, errorTimeout
}
panic("impossible")
}
1 change: 0 additions & 1 deletion lib/net/proxy/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,4 @@ func newDialer(proxy string) (Dialer, error) {
return nil, errorUnsupportedProxy
}
}
return nil, nil
}
1 change: 0 additions & 1 deletion lib/net/reverseconnection/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,6 @@ func (l *Listener) connect(network, serverAddress string, timeout time.Duration,
// Wait for other side to consume.
if _, err := rawConn.Read(buffer); err != nil {
return nil, errors.New("error reading sync byte: " + err.Error())
return nil, err
}
logger.Println("remote has consumed, injecting to local listener")
l.remember(rawConn)
Expand Down
2 changes: 1 addition & 1 deletion lib/objectserver/client/getObjects.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@ func (or *ObjectsReader) nextObject() (uint64, io.ReadCloser, error) {
}
size := or.sizes[or.nextIndex]
return size,
ioutil.NopCloser(&io.LimitedReader{or.reader, int64(size)}), nil
ioutil.NopCloser(&io.LimitedReader{R: or.reader, N: int64(size)}), nil
}

0 comments on commit ad06fae

Please sign in to comment.