Skip to content

Conversation

@Stavrospanakakis
Copy link
Contributor

return nil, NotFoundError is unreachable code so I refactored the method.

func (store *storage) PlaygroundGet(id string) (*types.Playground, error) {
	store.rw.Lock()
	defer store.rw.Unlock()
	if playground, found := store.db.Playgrounds[id]; !found {
		return nil, NotFoundError
	} else {
		return playground, nil
	}
        // unreachable code
	return nil, NotFoundError
}

@marcosnils marcosnils merged commit 94ec06a into play-with-docker:master Sep 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants