From c2ae77a607b6e103545aa83e8f2c7c5bf649846f Mon Sep 17 00:00:00 2001 From: Robert Tonic Date: Thu, 5 Sep 2019 17:12:09 -0400 Subject: Apply go fmt to the fsgofer changes. --- runsc/fsgofer/fsgofer.go | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/runsc/fsgofer/fsgofer.go b/runsc/fsgofer/fsgofer.go index e3b926798..89171c811 100644 --- a/runsc/fsgofer/fsgofer.go +++ b/runsc/fsgofer/fsgofer.go @@ -131,30 +131,30 @@ func (a *attachPoint) Attach() (p9.File, error) { // Hold the file descriptor we are converting into a p9.File var f *fd.FD - // Apply the S_IFMT bitmask so we can detect file type appropriately + // Apply the S_IFMT bitmask so we can detect file type appropriately switch fmtStat := stat.Mode & syscall.S_IFMT; { case fmtStat == syscall.S_IFSOCK: - // Attempt to open a connection. Bubble up the failures. - f, err = fd.OpenUnix(a.prefix) - if err != nil { - return nil, err - } + // Attempt to open a connection. Bubble up the failures. + f, err = fd.OpenUnix(a.prefix) + if err != nil { + return nil, err + } - default: - // Default to Read/Write permissions. - mode := syscall.O_RDWR + default: + // Default to Read/Write permissions. + mode := syscall.O_RDWR - // If the configuration is Read Only & the mount point is a directory, - // set the mode to Read Only. - if a.conf.ROMount || fmtStat == syscall.S_IFDIR { - mode = syscall.O_RDONLY - } + // If the configuration is Read Only & the mount point is a directory, + // set the mode to Read Only. + if a.conf.ROMount || fmtStat == syscall.S_IFDIR { + mode = syscall.O_RDONLY + } - // Open the mount point & capture the FD. - f, err = fd.Open(a.prefix, openFlags|mode, 0) - if err != nil { - return nil, fmt.Errorf("unable to open file %q, err: %v", a.prefix, err) - } + // Open the mount point & capture the FD. + f, err = fd.Open(a.prefix, openFlags|mode, 0) + if err != nil { + return nil, fmt.Errorf("unable to open file %q, err: %v", a.prefix, err) + } } // Close the connection if the UDS is already attached. -- cgit v1.2.3