mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
all: format sources with gofumpt v0.9.1
Since gofumpt v0.9.0 there's a new formatting rule to "clothe" any naked returns. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
@@ -125,7 +125,7 @@ func getSealableFile(comment, tmpDir string) (file *os.File, sealFn SealFunc, er
|
|||||||
// First, try an executable memfd (supported since Linux 3.17).
|
// First, try an executable memfd (supported since Linux 3.17).
|
||||||
file, sealFn, err = Memfd(comment)
|
file, sealFn, err = Memfd(comment)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return
|
return file, sealFn, err
|
||||||
}
|
}
|
||||||
logrus.Debugf("memfd cloned binary failed, falling back to O_TMPFILE: %v", err)
|
logrus.Debugf("memfd cloned binary failed, falling back to O_TMPFILE: %v", err)
|
||||||
|
|
||||||
@@ -154,7 +154,7 @@ func getSealableFile(comment, tmpDir string) (file *os.File, sealFn SealFunc, er
|
|||||||
file.Close()
|
file.Close()
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
return
|
return file, sealFn, err
|
||||||
}
|
}
|
||||||
logrus.Debugf("O_TMPFILE cloned binary failed, falling back to mktemp(): %v", err)
|
logrus.Debugf("O_TMPFILE cloned binary failed, falling back to mktemp(): %v", err)
|
||||||
// Finally, try a classic unlinked temporary file.
|
// Finally, try a classic unlinked temporary file.
|
||||||
@@ -168,7 +168,7 @@ func getSealableFile(comment, tmpDir string) (file *os.File, sealFn SealFunc, er
|
|||||||
file.Close()
|
file.Close()
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
return
|
return file, sealFn, err
|
||||||
}
|
}
|
||||||
return nil, nil, fmt.Errorf("could not create sealable file for cloned binary: %w", err)
|
return nil, nil, fmt.Errorf("could not create sealable file for cloned binary: %w", err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -210,7 +210,7 @@ func runContainer(t testing.TB, config *configs.Config, args ...string) (buffers
|
|||||||
} else {
|
} else {
|
||||||
return buffers, -1, err
|
return buffers, -1, err
|
||||||
}
|
}
|
||||||
return
|
return buffers, exitCode, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// runContainerOk is a wrapper for runContainer, simplifying its use for cases
|
// runContainerOk is a wrapper for runContainer, simplifying its use for cases
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ func (m Mapping) toSys() (uids, gids []syscall.SysProcIDMap) {
|
|||||||
Size: int(gid.Size),
|
Size: int(gid.Size),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return
|
return uids, gids
|
||||||
}
|
}
|
||||||
|
|
||||||
// id returns a unique identifier for this mapping, agnostic of the order of
|
// id returns a unique identifier for this mapping, agnostic of the order of
|
||||||
|
|||||||
@@ -236,7 +236,7 @@ func syscallMode(i fs.FileMode) (o uint32) {
|
|||||||
o |= unix.S_ISVTX
|
o |= unix.S_ISVTX
|
||||||
}
|
}
|
||||||
// No mapping for Go's ModeTemporary (plan9 only).
|
// No mapping for Go's ModeTemporary (plan9 only).
|
||||||
return
|
return o
|
||||||
}
|
}
|
||||||
|
|
||||||
// mountFd creates a "mount source fd" (either through open_tree(2) or just
|
// mountFd creates a "mount source fd" (either through open_tree(2) or just
|
||||||
|
|||||||
@@ -199,7 +199,7 @@ func newPipe(t *testing.T) (parent *os.File, child *os.File) {
|
|||||||
parent.Close()
|
parent.Close()
|
||||||
child.Close()
|
child.Close()
|
||||||
})
|
})
|
||||||
return
|
return parent, child
|
||||||
}
|
}
|
||||||
|
|
||||||
func reapChildren(t *testing.T, parent *os.File) {
|
func reapChildren(t *testing.T, parent *os.File) {
|
||||||
|
|||||||
@@ -1155,7 +1155,7 @@ func msMoveRoot(rootfs string) error {
|
|||||||
strings.HasPrefix(info.Mountpoint, rootfs) {
|
strings.HasPrefix(info.Mountpoint, rootfs) {
|
||||||
skip = true
|
skip = true
|
||||||
}
|
}
|
||||||
return
|
return skip, stop
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
@@ -676,7 +676,7 @@ func filterFlags(config *configs.Seccomp, filter *libseccomp.ScmpFilter) (flags
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return
|
return flags, noNewPrivs, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func sysSeccompSetFilter(flags uint, filter []unix.SockFilter) (fd int, err error) {
|
func sysSeccompSetFilter(flags uint, filter []unix.SockFilter) (fd int, err error) {
|
||||||
@@ -706,7 +706,7 @@ func sysSeccompSetFilter(flags uint, filter []unix.SockFilter) (fd int, err erro
|
|||||||
}
|
}
|
||||||
runtime.KeepAlive(filter)
|
runtime.KeepAlive(filter)
|
||||||
runtime.KeepAlive(fprog)
|
runtime.KeepAlive(fprog)
|
||||||
return
|
return fd, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// PatchAndLoad takes a seccomp configuration and a libseccomp filter which has
|
// PatchAndLoad takes a seccomp configuration and a libseccomp filter which has
|
||||||
|
|||||||
@@ -112,5 +112,5 @@ func Annotations(labels []string) (bundle string, userAnnotations map[string]str
|
|||||||
userAnnotations[name] = value
|
userAnnotations[name] = value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return
|
return bundle, userAnnotations
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user