Skip to content

Commit 2ae0fa7

Browse files
authored
Merge pull request #1599 from tklauser/unconvert
libcontainer: remove unnecessary type conversions
2 parents 79ad714 + d713652 commit 2ae0fa7

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

libcontainer/container_linux.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -670,9 +670,9 @@ func parseCriuVersion(path string) (int, error) {
670670
return 0, fmt.Errorf("Unable to parse the CRIU version: %s", path)
671671
}
672672

673-
n, err := fmt.Sscanf(string(version), "GitID: v%d.%d.%d", &x, &y, &z) // 1.5.2
673+
n, err := fmt.Sscanf(version, "GitID: v%d.%d.%d", &x, &y, &z) // 1.5.2
674674
if err != nil {
675-
n, err = fmt.Sscanf(string(version), "GitID: v%d.%d", &x, &y) // 1.6
675+
n, err = fmt.Sscanf(version, "GitID: v%d.%d", &x, &y) // 1.6
676676
y++
677677
} else {
678678
z++

libcontainer/init_linux.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,10 +260,10 @@ func setupUser(config *initConfig) error {
260260

261261
// Rather than just erroring out later in setuid(2) and setgid(2), check
262262
// that the user is mapped here.
263-
if _, err := config.Config.HostUID(int(execUser.Uid)); err != nil {
263+
if _, err := config.Config.HostUID(execUser.Uid); err != nil {
264264
return fmt.Errorf("cannot set uid to unmapped user in user namespace")
265265
}
266-
if _, err := config.Config.HostGID(int(execUser.Gid)); err != nil {
266+
if _, err := config.Config.HostGID(execUser.Gid); err != nil {
267267
return fmt.Errorf("cannot set gid to unmapped user in user namespace")
268268
}
269269

libcontainer/keys/keyctl.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func ModKeyringPerm(ringId KeySerial, mask, setbits uint32) error {
2929
return err
3030
}
3131

32-
res := strings.Split(string(dest), ";")
32+
res := strings.Split(dest, ";")
3333
if len(res) < 5 {
3434
return fmt.Errorf("Destination buffer for key description is too small")
3535
}

0 commit comments

Comments
 (0)