Skip to content

Check returned errors before deferring Close() #60

@riking

Description

@riking

This pattern is repeated several times in melody_test.go:

conn, err := NewDialer(server.URL)
defer conn.Close()
if err != nil {
	t.Error(err)
	return false
}

However, if there is an error, this is liable to cause a null reference panic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions