From d6a0f417c647fb19820fa0f689cb2964bc621459 Mon Sep 17 00:00:00 2001 From: Jack Christensen Date: Sat, 29 Jun 2013 19:42:52 -0500 Subject: [PATCH] Remove unreachable panics (Go 1.1 doesn't need them) --- connection.go | 11 ----------- sanitize.go | 1 - 2 files changed, 12 deletions(-) diff --git a/connection.go b/connection.go index 70dc17ae..980fbedf 100644 --- a/connection.go +++ b/connection.go @@ -101,8 +101,6 @@ func Connect(parameters ConnectionParameters) (c *Connection, err error) { return nil, err } } - - panic("Unreachable") } func (c *Connection) Close() (err error) { @@ -143,8 +141,6 @@ func (c *Connection) SelectFunc(sql string, onDataRow func(*DataRowReader) error return } } - - panic("Unreachable") } func (c *Connection) SelectRows(sql string, arguments ...interface{}) (rows []map[string]interface{}, err error) { @@ -255,8 +251,6 @@ func (c *Connection) Execute(sql string, arguments ...interface{}) (commandTag s return } } - - panic("Unreachable") } // Processes messages that are not exclusive to one context such as @@ -274,9 +268,6 @@ func (c *Connection) processContextFreeMsg(t byte, r *MessageReader) (err error) default: return fmt.Errorf("Received unknown message type: %c", t) } - - panic("Unreachable") - } func (c *Connection) rxMsg() (t byte, r *MessageReader, err error) { @@ -360,8 +351,6 @@ func (c *Connection) rxErrorResponse(r *MessageReader) (err PgError) { r.ReadString() } } - - panic("Unreachable") } func (c *Connection) rxBackendKeyData(r *MessageReader) { diff --git a/sanitize.go b/sanitize.go index 9365c042..0d2b92bc 100644 --- a/sanitize.go +++ b/sanitize.go @@ -50,7 +50,6 @@ func (c *Connection) SanitizeSql(sql string, args ...interface{}) (output string default: panic("Unable to sanitize type: " + reflect.TypeOf(arg).String()) } - panic("Unreachable") } output = literalPattern.ReplaceAllStringFunc(sql, replacer)