Skip to content

Commit

Permalink
Correct 'go vet' errors
Browse files Browse the repository at this point in the history
Use command 'go vet' to find errors:
```
go vet ./...
```
Correct all errors except these in vendor dir.

Signed-off-by: Fengtu Wang <[email protected]>
  • Loading branch information
FengtuWang committed May 10, 2017
1 parent 8ef7df5 commit 649cdd1
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion containerd-shim/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ func start(log *os.File) error {
}
}
}
return nil
}

func writeInt(path string, i int) error {
Expand Down
1 change: 0 additions & 1 deletion runtime/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,6 @@ func (c *container) createCmd(ctx context.Context, pid string, cmd *exec.Cmd, p
case err := <-ch:
return err
}
return nil
}

func hostIDFromMap(id uint32, mp []ocs.LinuxIDMapping) int {
Expand Down
2 changes: 1 addition & 1 deletion runtime/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ func (p *process) updateExitStatusFile(status uint32) (uint32, error) {
p.stateLock.Lock()
p.state = Stopped
p.stateLock.Unlock()
err := ioutil.WriteFile(filepath.Join(p.root, ExitStatusFile), []byte(fmt.Sprintf("%u", status)), 0644)
err := ioutil.WriteFile(filepath.Join(p.root, ExitStatusFile), []byte(fmt.Sprintf("%d", status)), 0644)
return status, err
}

Expand Down
2 changes: 1 addition & 1 deletion runtime/runtime_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func BenchmarkBusyboxSh(b *testing.B) {
})

if err != nil {
b.Fatalf("Error creating a New container: ", err)
b.Fatalf("Error creating a New container: %v", err)
}

benchmarkStartContainer(b, c, s, bundleName)
Expand Down
2 changes: 1 addition & 1 deletion testutils/testutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func untarRootfs(source string, destination string) error {
rootfs := filepath.Join(destination, "rootfs")

if err := os.MkdirAll(rootfs, 0755); err != nil {
fmt.Println("untarRootfs os.MkdirAll failed with err %v", err)
fmt.Printf("untarRootfs os.MkdirAll failed with err %v", err)
return nil
}
tar := exec.Command("tar", "-C", rootfs, "-xf", source)
Expand Down

0 comments on commit 649cdd1

Please sign in to comment.