diff --git a/hive.go b/hive.go index 211b47c..c1c26f2 100644 --- a/hive.go +++ b/hive.go @@ -1180,7 +1180,7 @@ func newCookieJar() inMemoryCookieJar { } func safeStatus(status *hiveserver.TStatus) *hiveserver.TStatus { - if (status == nil) { + if status == nil { return &DEFAULT_STATUS } return status @@ -1189,11 +1189,10 @@ func safeStatus(status *hiveserver.TStatus) *hiveserver.TStatus { var DEFAULT_SQL_STATE = "" var DEFAULT_ERROR_CODE = int32(-1) var DEFAULT_ERROR_MESSAGE = "unknown error" -var DEFAULT_STATUS = hiveserver.TStatus { - StatusCode: hiveserver.TStatusCode_ERROR_STATUS, - InfoMessages: nil, - SqlState: &DEFAULT_SQL_STATE, - ErrorCode: &DEFAULT_ERROR_CODE, - ErrorMessage: &DEFAULT_ERROR_MESSAGE, +var DEFAULT_STATUS = hiveserver.TStatus{ + StatusCode: hiveserver.TStatusCode_ERROR_STATUS, + InfoMessages: nil, + SqlState: &DEFAULT_SQL_STATE, + ErrorCode: &DEFAULT_ERROR_CODE, + ErrorMessage: &DEFAULT_ERROR_MESSAGE, } - diff --git a/hive_test.go b/hive_test.go index e63f6ed..23e43f0 100644 --- a/hive_test.go +++ b/hive_test.go @@ -32,7 +32,6 @@ func TestConnectDefault(t *testing.T) { connection.Close() } - func TestConnectZookeeper(t *testing.T) { configuration := NewConnectConfiguration() configuration.Service = "hive" @@ -681,10 +680,10 @@ func TestFetchLogs(t *testing.T) { func TestFetchLogsDuringExecution(t *testing.T) { connection, cursor := prepareTable(t, 2, 1000) // Buffered so we only have to read at end - + logs := make(chan []string, 30) defer close(logs) - + cursor.Logs = logs cursor.Execute(context.Background(), "SELECT * FROM pokes", false) if cursor.Error() != nil {