diff options
author | Ian Gudger <igudger@google.com> | 2018-05-08 09:51:07 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-05-08 09:51:56 -0700 |
commit | b4765f782d91443ab0415dc00e727d783632e2ad (patch) | |
tree | 82c2b45b7d9fee5ceaf3792e34c5fdf09c69da43 /pkg/sentry/fs/host | |
parent | d0d01a18963ed7cfc29e5b8334e30b1234b6048b (diff) |
Fix warning: redundant if ...; err != nil check, just return error instead.
This warning is produced by golint.
PiperOrigin-RevId: 195833381
Change-Id: Idd6a7e57e3cfdf00819f2374b19fc113585dc1e1
Diffstat (limited to 'pkg/sentry/fs/host')
-rw-r--r-- | pkg/sentry/fs/host/fs_test.go | 6 | ||||
-rw-r--r-- | pkg/sentry/fs/host/socket.go | 5 |
2 files changed, 2 insertions, 9 deletions
diff --git a/pkg/sentry/fs/host/fs_test.go b/pkg/sentry/fs/host/fs_test.go index c000afc49..b08125ca8 100644 --- a/pkg/sentry/fs/host/fs_test.go +++ b/pkg/sentry/fs/host/fs_test.go @@ -141,11 +141,7 @@ func createTestDirs(ctx context.Context, t *testing.T, m *fs.MountNamespace) err return err } - if err := symlinks.CreateLink(ctx, r, "/symlinks", "recursive"); err != nil { - return err - } - - return nil + return symlinks.CreateLink(ctx, r, "/symlinks", "recursive") } // allPaths returns a slice of all paths of entries visible in the rootfs. diff --git a/pkg/sentry/fs/host/socket.go b/pkg/sentry/fs/host/socket.go index 8e36ed7ee..467633052 100644 --- a/pkg/sentry/fs/host/socket.go +++ b/pkg/sentry/fs/host/socket.go @@ -69,10 +69,7 @@ func (e *endpoint) init() error { } e.stype = unix.SockType(stype) - if err := fdnotifier.AddFD(int32(e.fd), &e.queue); err != nil { - return err - } - return nil + return fdnotifier.AddFD(int32(e.fd), &e.queue) } // newEndpoint creates a new host endpoint. |