From 94ec06a3fe49dfc939f891c1c4b1f18c665ac7b7 Mon Sep 17 00:00:00 2001 From: Stavros Panakakis <53979866+Stavrospanakakis@users.noreply.github.com> Date: Tue, 7 Sep 2021 14:02:29 +0300 Subject: [PATCH] Refactor unreachable code (#490) --- storage/file.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/storage/file.go b/storage/file.go index aac4cf2..adf1ae9 100644 --- a/storage/file.go +++ b/storage/file.go @@ -376,12 +376,13 @@ func (store *storage) PlaygroundPut(playground *types.Playground) error { func (store *storage) PlaygroundGet(id string) (*types.Playground, error) { store.rw.Lock() defer store.rw.Unlock() - if playground, found := store.db.Playgrounds[id]; !found { + + playground, found := store.db.Playgrounds[id] + if !found { return nil, NotFoundError - } else { - return playground, nil } - return nil, NotFoundError + + return playground, nil } func (store *storage) load() error {